br_nfe 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +0 -1
  4. data/Gemfile.lock +1 -1
  5. data/README.markdown +264 -106
  6. data/lib/br_nfe/{helper → association}/have_address.rb +1 -1
  7. data/lib/br_nfe/{helper → association}/have_condicao_pagamento.rb +1 -1
  8. data/lib/br_nfe/association/have_destinatario.rb +22 -0
  9. data/lib/br_nfe/association/have_emitente.rb +24 -0
  10. data/lib/br_nfe/base.rb +37 -27
  11. data/lib/br_nfe/condicao_pagamento.rb +2 -0
  12. data/lib/br_nfe/constants.rb +33 -0
  13. data/lib/br_nfe/endereco.rb +10 -0
  14. data/lib/br_nfe/helper/string_methods.rb +4 -0
  15. data/lib/br_nfe/{emitente.rb → person.rb} +11 -7
  16. data/lib/br_nfe/product/base.rb +82 -0
  17. data/lib/br_nfe/product/consulta_status_servico.rb +35 -0
  18. data/lib/br_nfe/product/emitente.rb +8 -0
  19. data/lib/br_nfe/product/gateway/base.rb +62 -0
  20. data/lib/br_nfe/product/gateway/web_service_svrs.rb +39 -0
  21. data/lib/br_nfe/product/value_nf.rb +9 -0
  22. data/lib/br_nfe/product/xml/soap_env.xml.slim +8 -0
  23. data/lib/br_nfe/product/xml/v3_10/XSD/consReciNFe_v3.10.xsd +9 -0
  24. data/lib/br_nfe/product/xml/v3_10/XSD/consSitNFe_v3.10.xsd +9 -0
  25. data/lib/br_nfe/product/xml/v3_10/XSD/consStatServ_v3.10.xsd +9 -0
  26. data/lib/br_nfe/product/xml/v3_10/XSD/enviNFe_v3.10.xsd +9 -0
  27. data/lib/br_nfe/product/xml/v3_10/XSD/inutNFe_v3.10.xsd +9 -0
  28. data/lib/br_nfe/product/xml/v3_10/XSD/leiauteConsSitNFe_v3.10.xsd +502 -0
  29. data/lib/br_nfe/product/xml/v3_10/XSD/leiauteConsStatServ_v3.10.xsd +98 -0
  30. data/lib/br_nfe/product/xml/v3_10/XSD/leiauteInutNFe_v3.10.xsd +193 -0
  31. data/lib/br_nfe/product/xml/v3_10/XSD/leiauteNFe_v3.10.xsd +6060 -0
  32. data/lib/br_nfe/product/xml/v3_10/XSD/nfe_v3.10.xsd +9 -0
  33. data/lib/br_nfe/product/xml/v3_10/XSD/procInutNFe_v3.10.xsd +9 -0
  34. data/lib/br_nfe/product/xml/v3_10/XSD/procNFe_v3.10.xsd +9 -0
  35. data/lib/br_nfe/product/xml/v3_10/XSD/retConsReciNFe_v3.10.xsd +9 -0
  36. data/lib/br_nfe/product/xml/v3_10/XSD/retConsSitNFe_v3.10.xsd +9 -0
  37. data/lib/br_nfe/product/xml/v3_10/XSD/retConsStatServ_v3.10.xsd +9 -0
  38. data/lib/br_nfe/product/xml/v3_10/XSD/retEnviNFe_v3.10.xsd +9 -0
  39. data/lib/br_nfe/product/xml/v3_10/XSD/retInutNFe_v3.10.xsd +9 -0
  40. data/lib/br_nfe/product/xml/v3_10/XSD/tiposBasico_v3.10.xsd +571 -0
  41. data/lib/br_nfe/product/xml/v3_10/XSD/xmldsig-core-schema_v1.01.xsd +98 -0
  42. data/lib/br_nfe/product/xml/v3_10/consulta_status_servico.xml.slim +4 -0
  43. data/lib/br_nfe/service/association/have_intermediario.rb +26 -0
  44. data/lib/br_nfe/service/association/have_rps.rb +36 -0
  45. data/lib/br_nfe/service/base.rb +24 -20
  46. data/lib/br_nfe/service/betha/v1/cancela_nfse.rb +43 -0
  47. data/lib/br_nfe/service/betha/v1/consulta_lote_rps.rb +20 -6
  48. data/lib/br_nfe/service/betha/v1/consulta_nfs_por_rps.rb +17 -6
  49. data/lib/br_nfe/service/betha/v1/consulta_nfse.rb +16 -5
  50. data/lib/br_nfe/service/betha/v1/consulta_situacao_lote_rps.rb +15 -6
  51. data/lib/br_nfe/service/betha/v1/gateway.rb +4 -0
  52. data/lib/br_nfe/service/betha/v1/recepcao_lote_rps.rb +13 -5
  53. data/lib/br_nfe/service/betha/v1/xml/_tc_identificacao_prestador.xml.slim +3 -0
  54. data/lib/br_nfe/service/betha/v1/xml/_tc_pedido_cancelamento.xml.slim +4 -0
  55. data/lib/br_nfe/service/concerns/rules/cancelamento_nfs.rb +8 -0
  56. data/lib/br_nfe/service/concerns/rules/consulta_nfs_por_rps.rb +1 -1
  57. data/lib/br_nfe/service/concerns/rules/consulta_nfse.rb +5 -2
  58. data/lib/br_nfe/service/concerns/values_ts/service_v1.rb +319 -0
  59. data/lib/br_nfe/service/destinatario.rb +7 -0
  60. data/lib/br_nfe/service/emitente.rb +8 -0
  61. data/lib/br_nfe/service/intermediario.rb +1 -12
  62. data/lib/br_nfe/service/item.rb +7 -7
  63. data/lib/br_nfe/service/response/build/base.rb +166 -0
  64. data/lib/br_nfe/service/response/build/cancelamento.rb +62 -0
  65. data/lib/br_nfe/service/response/build/consulta_lote_rps.rb +25 -0
  66. data/lib/br_nfe/service/response/build/consulta_nfs_por_rps.rb +25 -0
  67. data/lib/br_nfe/service/response/build/consulta_nfse.rb +24 -0
  68. data/lib/br_nfe/service/response/build/consulta_situacao_lote_rps.rb +56 -0
  69. data/lib/br_nfe/service/response/build/invoice_build.rb +359 -0
  70. data/lib/br_nfe/service/response/build/recepcao_lote_rps.rb +69 -0
  71. data/lib/br_nfe/service/response/cancelamento.rb +22 -0
  72. data/lib/br_nfe/service/response/consulta_lote_rps.rb +18 -0
  73. data/lib/br_nfe/service/response/consulta_nfs_por_rps.rb +10 -0
  74. data/lib/br_nfe/service/response/consulta_nfse.rb +10 -0
  75. data/lib/br_nfe/service/response/consulta_situacao_lote_rps.rb +74 -0
  76. data/lib/br_nfe/service/response/default.rb +93 -0
  77. data/lib/br_nfe/{response/service → service/response}/nota_fiscal.rb +19 -12
  78. data/lib/br_nfe/service/response/paths/v1/tc_nfse.rb +275 -0
  79. data/lib/br_nfe/service/response/recepcao_lote_rps.rb +35 -0
  80. data/lib/br_nfe/service/rps.rb +30 -27
  81. data/lib/br_nfe/service/sc/florianopolis/xml/_service_item.xml.slim +4 -4
  82. data/lib/br_nfe/service/sc/florianopolis/xml/inf_requisicao.xml.slim +4 -4
  83. data/lib/br_nfe/service/simpliss/v1/cancela_nfse.rb +16 -6
  84. data/lib/br_nfe/service/simpliss/v1/consulta_lote_rps.rb +20 -12
  85. data/lib/br_nfe/service/simpliss/v1/consulta_nfs_por_rps.rb +21 -6
  86. data/lib/br_nfe/service/simpliss/v1/consulta_nfse.rb +20 -6
  87. data/lib/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps.rb +17 -6
  88. data/lib/br_nfe/service/simpliss/v1/recepcao_lote_rps.rb +16 -4
  89. data/lib/br_nfe/service/simpliss/v1/xml/_tc_item_servico.xml.slim +2 -2
  90. data/lib/br_nfe/service/thema/v1/cancela_nfse.rb +21 -19
  91. data/lib/br_nfe/service/thema/v1/consulta_lote_rps.rb +21 -19
  92. data/lib/br_nfe/service/thema/v1/consulta_nfs_por_rps.rb +25 -18
  93. data/lib/br_nfe/service/thema/v1/consulta_nfse.rb +20 -20
  94. data/lib/br_nfe/service/thema/v1/consulta_situacao_lote_rps.rb +14 -20
  95. data/lib/br_nfe/service/thema/v1/recepcao_lote_rps.rb +11 -16
  96. data/lib/br_nfe/service/thema/v1/recepcao_lote_rps_limitado.rb +8 -6
  97. data/lib/br_nfe/service/xml/v1/_tc_identificacao_nfse.xml.slim +1 -1
  98. data/lib/br_nfe/service/xml/v1/_tc_pedido_cancelamento.xml.slim +1 -1
  99. data/lib/br_nfe/service/xml/v1/_tc_valores.xml.slim +11 -11
  100. data/lib/br_nfe/version.rb +1 -1
  101. data/lib/br_nfe.rb +62 -62
  102. data/test/br_nfe/association/have_address_test.rb +64 -0
  103. data/test/br_nfe/association/have_condicao_pagamento_test.rb +75 -0
  104. data/test/br_nfe/association/have_destinatario_test.rb +76 -0
  105. data/test/br_nfe/association/have_emitente_test.rb +80 -0
  106. data/test/br_nfe/base_test.rb +96 -61
  107. data/test/br_nfe/endereco_test.rb +21 -0
  108. data/test/br_nfe/person_test.rb +55 -0
  109. data/test/br_nfe/product/base_test.rb +150 -0
  110. data/test/br_nfe/product/consulta_status_servico_test.rb +59 -0
  111. data/test/br_nfe/product/emitente_test.rb +29 -0
  112. data/test/br_nfe/product/gateway/base_test.rb +16 -0
  113. data/test/br_nfe/product/gateway/web_service_svrs_test.rb +36 -0
  114. data/test/br_nfe/service/association/have_intermediario_test.rb +80 -0
  115. data/test/br_nfe/service/association/have_rps_test.rb +62 -0
  116. data/test/br_nfe/service/base_test.rb +42 -42
  117. data/test/br_nfe/service/betha/v1/cancela_nfse_test.rb +90 -0
  118. data/test/br_nfe/service/betha/v1/consulta_lote_rps_test.rb +105 -5
  119. data/test/br_nfe/service/betha/v1/consulta_nfs_por_rps_test.rb +103 -5
  120. data/test/br_nfe/service/betha/v1/consulta_nfse_test.rb +114 -5
  121. data/test/br_nfe/service/betha/v1/consulta_situacao_lote_rps_test.rb +118 -5
  122. data/test/br_nfe/service/betha/v1/gateway_test.rb +1 -1
  123. data/test/br_nfe/service/betha/v1/recepcao_lote_rps_test.rb +51 -5
  124. data/test/br_nfe/service/concerns/rules/cancelamento_nfs_test.rb +2 -2
  125. data/test/br_nfe/service/concerns/rules/consulta_nfs_por_rps_test.rb +2 -7
  126. data/test/br_nfe/service/concerns/rules/consulta_nfse_test.rb +24 -3
  127. data/test/br_nfe/service/concerns/rules/recepcao_lote_rps_test.rb +1 -1
  128. data/test/br_nfe/{helper → service/concerns}/values_ts/service_v1_test.rb +2 -2
  129. data/test/br_nfe/{destinatario_test.rb → service/destinatario_test.rb} +3 -4
  130. data/test/br_nfe/service/emitente_test.rb +29 -0
  131. data/test/br_nfe/service/item_test.rb +14 -14
  132. data/test/br_nfe/service/response/build/base_test.rb +80 -0
  133. data/test/br_nfe/{response/service → service/response}/default_test.rb +1 -82
  134. data/test/br_nfe/service/response/nota_fiscal_test.rb +59 -0
  135. data/test/br_nfe/{response/service → service/response}/paths/v1/tc_nfse_test.rb +10 -10
  136. data/test/br_nfe/service/rps_test.rb +107 -138
  137. data/test/br_nfe/service/sc/florianopolis/emission_rps_test.rb +9 -9
  138. data/test/br_nfe/service/simpliss/v1/base_test.rb +1 -1
  139. data/test/br_nfe/service/simpliss/v1/cancela_nfse_test.rb +7 -10
  140. data/test/br_nfe/service/simpliss/v1/consulta_lote_rps_test.rb +11 -18
  141. data/test/br_nfe/service/simpliss/v1/consulta_nfs_por_rps_test.rb +11 -18
  142. data/test/br_nfe/service/simpliss/v1/consulta_nfse_test.rb +11 -18
  143. data/test/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps_test.rb +7 -11
  144. data/test/br_nfe/service/simpliss/v1/recepcao_lote_rps_test.rb +3 -9
  145. data/test/br_nfe/service/thema/v1/base_test.rb +1 -1
  146. data/test/br_nfe/service/thema/v1/cancela_nfse_test.rb +7 -14
  147. data/test/br_nfe/service/thema/v1/consulta_lote_rps_test.rb +6 -17
  148. data/test/br_nfe/service/thema/v1/consulta_nfs_por_rps_test.rb +6 -13
  149. data/test/br_nfe/service/thema/v1/consulta_nfse_test.rb +11 -18
  150. data/test/br_nfe/service/thema/v1/consulta_situacao_lote_rps_test.rb +7 -11
  151. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_limitado_test.rb +1 -5
  152. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test.rb +3 -9
  153. data/test/factories/base.rb +0 -1
  154. data/test/factories/{emitente.rb → person.rb} +1 -1
  155. data/test/factories/product/base.rb +12 -0
  156. data/test/factories/product/consulta_status_servico.rb +12 -0
  157. data/test/factories/product/emitente.rb +15 -0
  158. data/test/factories/product/gateway/base.rb +5 -0
  159. data/test/factories/product/gateway/web_service_svrs.rb +5 -0
  160. data/test/factories/service/betha/v1/{cancelamento_nfs.rb → cancela_nfse.rb} +2 -1
  161. data/test/factories/service/betha/v1/consulta_lote_rps.rb +1 -1
  162. data/test/factories/service/betha/v1/consulta_nfs_por_rps.rb +1 -1
  163. data/test/factories/service/betha/v1/consulta_nfse.rb +1 -1
  164. data/test/factories/service/betha/v1/consulta_situacao_lote_rps.rb +1 -1
  165. data/test/factories/{destinatario.rb → service/destinatario.rb} +1 -1
  166. data/test/factories/service/emitente.rb +15 -0
  167. data/test/factories/service/item.rb +4 -4
  168. data/test/factories/service/response/build_response.rb +5 -0
  169. data/test/factories/service/response/default.rb +6 -0
  170. data/test/factories/{response/service → service/response}/nota_fiscal.rb +8 -8
  171. data/test/factories/service/rps.rb +11 -11
  172. data/test/factories/service/sc/florianopolis/base.rb +1 -1
  173. data/test/factories/service/sc/florianopolis/cancellation.rb +1 -1
  174. data/test/factories/service/sc/florianopolis/emission_rps.rb +1 -1
  175. data/test/factories/service/simpliss/v1/base.rb +1 -1
  176. data/test/factories/service/simpliss/v1/cancela_nfse.rb +1 -1
  177. data/test/factories/service/simpliss/v1/consulta_lote_rps.rb +1 -1
  178. data/test/factories/service/simpliss/v1/consulta_nfs_por_rps.rb +1 -1
  179. data/test/factories/service/simpliss/v1/consulta_nfse.rb +1 -1
  180. data/test/factories/service/simpliss/v1/consulta_situacao_lote_rps.rb +1 -1
  181. data/test/factories/service/simpliss/v1/recepcao_lote_rps.rb +1 -1
  182. data/test/factories/service/thema/v1/base.rb +1 -1
  183. data/test/factories/service/thema/v1/cancela_nfse.rb +1 -1
  184. data/test/factories/service/thema/v1/consulta_lote_rps.rb +1 -1
  185. data/test/factories/service/thema/v1/consulta_nfs_por_rps.rb +1 -1
  186. data/test/factories/service/thema/v1/consulta_nfse.rb +1 -1
  187. data/test/factories/service/thema/v1/consulta_situacao_lote_rps.rb +1 -1
  188. data/test/factories/service/thema/v1/recepcao_lote_rps.rb +1 -1
  189. data/test/fixtures/service/response/betha/v1/cancela_nfse/fault.xml +17 -0
  190. data/test/fixtures/service/response/betha/v1/cancela_nfse/success.xml +48 -0
  191. data/test/fixtures/service/response/betha/v1/consulta_lote_rps/fault.xml +18 -0
  192. data/test/fixtures/service/response/betha/v1/consulta_lote_rps/success.xml +108 -0
  193. data/test/fixtures/service/response/betha/v1/consulta_nfse/fault.xml +18 -0
  194. data/test/fixtures/service/response/betha/v1/consulta_nfse/nfs_empty.xml +12 -0
  195. data/test/fixtures/service/response/betha/v1/consulta_nfse/success.xml +115 -0
  196. data/test/fixtures/service/response/betha/v1/consulta_nfse_por_rps/fault.xml +18 -0
  197. data/test/fixtures/service/response/betha/v1/consulta_nfse_por_rps/success.xml +103 -0
  198. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/error.xml +13 -0
  199. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/fault.xml +17 -0
  200. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/success.xml +13 -0
  201. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/unprocessed.xml +13 -0
  202. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/unprocessed_by_code_error.xml +17 -0
  203. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/unreceived.xml +13 -0
  204. data/test/fixtures/service/response/betha/v1/consulta_situacao_lote_rps/unreceived_by_code_error.xml +17 -0
  205. data/test/fixtures/service/response/betha/v1/recepcao_lote_rps/error.xml +17 -0
  206. data/test/fixtures/service/response/betha/v1/recepcao_lote_rps/success.xml +14 -0
  207. metadata +160 -94
  208. data/lib/br_nfe/destinatario.rb +0 -26
  209. data/lib/br_nfe/helper/have_destinatario.rb +0 -18
  210. data/lib/br_nfe/helper/have_emitente.rb +0 -20
  211. data/lib/br_nfe/helper/have_intermediario.rb +0 -24
  212. data/lib/br_nfe/helper/have_rps.rb +0 -34
  213. data/lib/br_nfe/helper/values_ts/service_v1.rb +0 -317
  214. data/lib/br_nfe/response/service/build_response.rb +0 -463
  215. data/lib/br_nfe/response/service/default.rb +0 -185
  216. data/lib/br_nfe/response/service/paths/base.rb +0 -127
  217. data/lib/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta.rb +0 -22
  218. data/lib/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta.rb +0 -25
  219. data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta.rb +0 -25
  220. data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta.rb +0 -25
  221. data/lib/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta.rb +0 -31
  222. data/lib/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta.rb +0 -36
  223. data/lib/br_nfe/response/service/paths/v1/tc_nfse.rb +0 -271
  224. data/lib/br_nfe/service/betha/v1/cancelamento_nfs.rb +0 -36
  225. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta.rb +0 -23
  226. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta.rb +0 -21
  227. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +0 -21
  228. data/lib/br_nfe/service/simpliss/v1/response_paths/servico_cancelar_nfse_resposta.rb +0 -22
  229. data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_lote_rps_resposta.rb +0 -25
  230. data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_nfse_resposta.rb +0 -25
  231. data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +0 -25
  232. data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_situacao_lote_rps_resposta.rb +0 -31
  233. data/lib/br_nfe/service/simpliss/v1/response_paths/servico_enviar_lote_rps_resposta.rb +0 -36
  234. data/lib/br_nfe/service/thema/v1/response_paths/servico_cancelar_nfse_resposta.rb +0 -17
  235. data/lib/br_nfe/service/thema/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +0 -19
  236. data/test/br_nfe/emitente_test.rb +0 -46
  237. data/test/br_nfe/helper/have_address_test.rb +0 -62
  238. data/test/br_nfe/helper/have_condicao_pagamento_test.rb +0 -71
  239. data/test/br_nfe/helper/have_destinatario_test.rb +0 -64
  240. data/test/br_nfe/helper/have_emitente_test.rb +0 -63
  241. data/test/br_nfe/helper/have_intermediario_test.rb +0 -77
  242. data/test/br_nfe/helper/have_rps_test.rb +0 -59
  243. data/test/br_nfe/response/service/build_response_test.rb +0 -205
  244. data/test/br_nfe/response/service/nota_fiscal_test.rb +0 -41
  245. data/test/br_nfe/response/service/paths/base_test.rb +0 -196
  246. data/test/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta_test.rb +0 -25
  247. data/test/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta_test.rb +0 -30
  248. data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta_test.rb +0 -30
  249. data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta_test.rb +0 -30
  250. data/test/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta_test.rb +0 -30
  251. data/test/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta_test.rb +0 -34
  252. data/test/br_nfe/service/betha/v1/cancelamento_nfs_test.rb +0 -54
  253. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta_test.rb +0 -16
  254. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta_test.rb +0 -16
  255. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta_test.rb +0 -16
  256. data/test/factories/response/service/build_response.rb +0 -5
  257. data/test/factories/response/service/default.rb +0 -10
@@ -3,7 +3,7 @@ require 'test_helper'
3
3
  describe BrNfe::Service::Simpliss::V1::Base do
4
4
  subject { FactoryGirl.build(:service_simpliss_v1_base, emitente: emitente) }
5
5
  let(:rps) { FactoryGirl.build(:br_nfe_rps, :completo) }
6
- let(:emitente) { FactoryGirl.build(:emitente) }
6
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
7
7
  let(:intermediario) { FactoryGirl.build(:intermediario) }
8
8
 
9
9
  describe "inheritance class" do
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Simpliss::V1::CancelaNfse do
4
4
  subject { FactoryGirl.build(:service_simpliss_v1_cancela_nfse, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
 
7
7
  describe "superclass" do
8
8
  it { subject.class.superclass.must_equal BrNfe::Service::Simpliss::V1::Base }
@@ -16,10 +16,6 @@ describe BrNfe::Service::Simpliss::V1::CancelaNfse do
16
16
  it { subject.method_wsdl.must_equal :cancelar_nfse }
17
17
  end
18
18
 
19
- it "#response_root_path" do
20
- subject.response_root_path.must_equal [:cancelar_nfse_response]
21
- end
22
-
23
19
  it "#body_xml_path" do
24
20
  subject.body_xml_path.must_equal []
25
21
  end
@@ -62,7 +58,11 @@ describe BrNfe::Service::Simpliss::V1::CancelaNfse do
62
58
  subject.request
63
59
  response = subject.response
64
60
 
65
- response.cancelation_date_time.must_equal Time.parse('2016-07-29T09:38:24.4803985-03:00')
61
+ response.must_be_kind_of BrNfe::Service::Response::Cancelamento
62
+ response.data_hora_cancelamento.must_equal Time.parse('2016-07-29T09:38:24.4803985-03:00')
63
+ response.codigo_cancelamento.must_equal '2'
64
+ response.numero_nfs.must_equal '3'
65
+
66
66
  response.status.must_equal :success
67
67
  response.successful_request?.must_equal true
68
68
  end
@@ -74,10 +74,7 @@ describe BrNfe::Service::Simpliss::V1::CancelaNfse do
74
74
  subject.request
75
75
  response = subject.response
76
76
 
77
- response.protocolo.must_be_nil
78
- response.data_recebimento.must_be_nil
79
- response.numero_lote.must_be_nil
80
- response.cancelation_date_time.must_be_nil
77
+ response.data_hora_cancelamento.must_be_nil
81
78
 
82
79
  response.status.must_equal :falied
83
80
 
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Simpliss::V1::ConsultaLoteRps do
4
4
  subject { FactoryGirl.build(:service_simpliss_v1_consulta_lote_rps, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
 
7
7
  it { must validate_presence_of(:protocolo) }
8
8
 
@@ -14,10 +14,6 @@ describe BrNfe::Service::Simpliss::V1::ConsultaLoteRps do
14
14
  it { subject.method_wsdl.must_equal :consultar_lote_rps }
15
15
  end
16
16
 
17
- it "#response_root_path" do
18
- subject.response_root_path.must_equal [:consultar_lote_rps_response]
19
- end
20
-
21
17
  it "#body_xml_path" do
22
18
  subject.body_xml_path.must_equal []
23
19
  end
@@ -60,9 +56,6 @@ describe BrNfe::Service::Simpliss::V1::ConsultaLoteRps do
60
56
  subject.request
61
57
  response = subject.response
62
58
 
63
- response.protocolo.must_be_nil
64
- response.data_recebimento.must_be_nil
65
- response.numero_lote.must_be_nil
66
59
  response.status.must_equal :falied
67
60
  response.error_messages.size.must_equal 2
68
61
  response.error_messages[0][:code].must_equal 'E138'
@@ -108,13 +101,13 @@ describe BrNfe::Service::Simpliss::V1::ConsultaLoteRps do
108
101
  nf.cnae_code.must_equal '6202300'
109
102
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
110
103
  nf.codigo_municipio.must_equal '4204202'
111
- nf.total_services.must_equal '10'
112
- nf.iss_retained.must_equal '2'
104
+ nf.valor_total_servicos.must_equal '10'
105
+ nf.iss_retido.must_equal '2'
113
106
  nf.total_iss.must_equal '0.2'
114
- nf.base_calculation.must_equal '10'
115
- nf.iss_tax_rate.must_equal '3.5'
107
+ nf.base_calculo.must_equal '10'
108
+ nf.iss_aliquota.must_equal '3.5'
116
109
  nf.valor_liquido.must_equal '10'
117
- nf.deductions.must_be_nil
110
+ nf.deducoes.must_be_nil
118
111
  nf.valor_pis.must_be_nil
119
112
  nf.valor_cofins.must_be_nil
120
113
  nf.valor_inss.must_be_nil
@@ -176,13 +169,13 @@ describe BrNfe::Service::Simpliss::V1::ConsultaLoteRps do
176
169
  nf.cnae_code.must_equal '6202300'
177
170
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
178
171
  nf.codigo_municipio.must_equal '4204202'
179
- nf.total_services.must_equal '500'
180
- nf.iss_retained.must_equal '2'
172
+ nf.valor_total_servicos.must_equal '500'
173
+ nf.iss_retido.must_equal '2'
181
174
  nf.total_iss.must_equal '0.2'
182
- nf.base_calculation.must_equal '10'
183
- nf.iss_tax_rate.must_equal '2'
175
+ nf.base_calculo.must_equal '10'
176
+ nf.iss_aliquota.must_equal '2'
184
177
  nf.valor_liquido.must_equal '463.02'
185
- nf.deductions.must_equal '7'
178
+ nf.deducoes.must_equal '7'
186
179
  nf.valor_pis.must_equal '1.12'
187
180
  nf.valor_cofins.must_equal '2.12'
188
181
  nf.valor_inss.must_equal '3.12'
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Simpliss::V1::ConsultaNfsPorRps do
4
4
  subject { FactoryGirl.build(:service_simpliss_v1_consulta_nfs_por_rps, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
  let(:rps) { subject.rps }
7
7
 
8
8
  describe "superclass" do
@@ -17,13 +17,6 @@ describe BrNfe::Service::Simpliss::V1::ConsultaNfsPorRps do
17
17
  it { subject.method_wsdl.must_equal :consultar_nfse_por_rps }
18
18
  end
19
19
 
20
- it "#response_root_path" do
21
- subject.response_root_path.must_equal [:consultar_nfse_por_rps_response]
22
- end
23
- it "#body_xml_path" do
24
- subject.body_xml_path.must_equal []
25
- end
26
-
27
20
  it "#soap_body_root_tag" do
28
21
  subject.soap_body_root_tag.must_equal 'ConsultarNfsePorRps'
29
22
  end
@@ -105,13 +98,13 @@ describe BrNfe::Service::Simpliss::V1::ConsultaNfsPorRps do
105
98
  nf.cnae_code.must_equal '6202300'
106
99
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
107
100
  nf.codigo_municipio.must_equal '4204202'
108
- nf.total_services.must_equal '10'
109
- nf.iss_retained.must_equal '2'
101
+ nf.valor_total_servicos.must_equal '10'
102
+ nf.iss_retido.must_equal '2'
110
103
  nf.total_iss.must_equal '0.2'
111
- nf.base_calculation.must_equal '10'
112
- nf.iss_tax_rate.must_equal '3.5'
104
+ nf.base_calculo.must_equal '10'
105
+ nf.iss_aliquota.must_equal '3.5'
113
106
  nf.valor_liquido.must_equal '10'
114
- nf.deductions.must_be_nil
107
+ nf.deducoes.must_be_nil
115
108
  nf.valor_pis.must_be_nil
116
109
  nf.valor_cofins.must_be_nil
117
110
  nf.valor_inss.must_be_nil
@@ -173,13 +166,13 @@ describe BrNfe::Service::Simpliss::V1::ConsultaNfsPorRps do
173
166
  nf.cnae_code.must_equal '6202300'
174
167
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
175
168
  nf.codigo_municipio.must_equal '4204202'
176
- nf.total_services.must_equal '500'
177
- nf.iss_retained.must_equal '2'
169
+ nf.valor_total_servicos.must_equal '500'
170
+ nf.iss_retido.must_equal '2'
178
171
  nf.total_iss.must_equal '0.2'
179
- nf.base_calculation.must_equal '10'
180
- nf.iss_tax_rate.must_equal '2'
172
+ nf.base_calculo.must_equal '10'
173
+ nf.iss_aliquota.must_equal '2'
181
174
  nf.valor_liquido.must_equal '463.02'
182
- nf.deductions.must_equal '7'
175
+ nf.deducoes.must_equal '7'
183
176
  nf.valor_pis.must_equal '1.12'
184
177
  nf.valor_cofins.must_equal '2.12'
185
178
  nf.valor_inss.must_equal '3.12'
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Simpliss::V1::ConsultaNfse do
4
4
  subject { FactoryGirl.build(:service_simpliss_v1_consulta_nfse, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
  let(:rps) { subject.rps }
7
7
 
8
8
  describe "superclass" do
@@ -17,13 +17,6 @@ describe BrNfe::Service::Simpliss::V1::ConsultaNfse do
17
17
  it { subject.method_wsdl.must_equal :consultar_nfse }
18
18
  end
19
19
 
20
- it "#response_root_path" do
21
- subject.response_root_path.must_equal [:consultar_nfse_response]
22
- end
23
- it "#body_xml_path" do
24
- subject.body_xml_path.must_equal []
25
- end
26
-
27
20
  it "#soap_body_root_tag" do
28
21
  subject.soap_body_root_tag.must_equal 'ConsultarNfse'
29
22
  end
@@ -92,13 +85,13 @@ describe BrNfe::Service::Simpliss::V1::ConsultaNfse do
92
85
  nf.cnae_code.must_equal '6202300'
93
86
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
94
87
  nf.codigo_municipio.must_equal '4204202'
95
- nf.total_services.must_equal '10'
96
- nf.iss_retained.must_equal '2'
88
+ nf.valor_total_servicos.must_equal '10'
89
+ nf.iss_retido.must_equal '2'
97
90
  nf.total_iss.must_equal '0.2'
98
- nf.base_calculation.must_equal '10'
99
- nf.iss_tax_rate.must_equal '3.5'
91
+ nf.base_calculo.must_equal '10'
92
+ nf.iss_aliquota.must_equal '3.5'
100
93
  nf.valor_liquido.must_equal '10'
101
- nf.deductions.must_be_nil
94
+ nf.deducoes.must_be_nil
102
95
  nf.valor_pis.must_be_nil
103
96
  nf.valor_cofins.must_be_nil
104
97
  nf.valor_inss.must_be_nil
@@ -160,13 +153,13 @@ describe BrNfe::Service::Simpliss::V1::ConsultaNfse do
160
153
  nf.cnae_code.must_equal '6202300'
161
154
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
162
155
  nf.codigo_municipio.must_equal '4204202'
163
- nf.total_services.must_equal '500'
164
- nf.iss_retained.must_equal '2'
156
+ nf.valor_total_servicos.must_equal '500'
157
+ nf.iss_retido.must_equal '2'
165
158
  nf.total_iss.must_equal '0.2'
166
- nf.base_calculation.must_equal '10'
167
- nf.iss_tax_rate.must_equal '2'
159
+ nf.base_calculo.must_equal '10'
160
+ nf.iss_aliquota.must_equal '2'
168
161
  nf.valor_liquido.must_equal '463.02'
169
- nf.deductions.must_equal '7'
162
+ nf.deducoes.must_equal '7'
170
163
  nf.valor_pis.must_equal '1.12'
171
164
  nf.valor_cofins.must_equal '2.12'
172
165
  nf.valor_inss.must_equal '3.12'
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Simpliss::V1::ConsultaSituacaoLoteRps do
4
4
  subject { FactoryGirl.build(:service_simpliss_v1_consulta_situacao_lote_rps, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
 
7
7
  it { must validate_presence_of(:protocolo) }
8
8
 
@@ -14,14 +14,6 @@ describe BrNfe::Service::Simpliss::V1::ConsultaSituacaoLoteRps do
14
14
  it { subject.method_wsdl.must_equal :consultar_situacao_lote_rps }
15
15
  end
16
16
 
17
- it "#response_root_path" do
18
- subject.response_root_path.must_equal [:consultar_situacao_lote_rps_response]
19
- end
20
-
21
- it "#body_xml_path" do
22
- subject.body_xml_path.must_equal []
23
- end
24
-
25
17
  it "#soap_body_root_tag" do
26
18
  subject.soap_body_root_tag.must_equal 'ConsultarSituacaoLoteRps'
27
19
  end
@@ -59,6 +51,7 @@ describe BrNfe::Service::Simpliss::V1::ConsultaSituacaoLoteRps do
59
51
  subject.request
60
52
  response = subject.response
61
53
 
54
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
62
55
  response.situation.must_equal :success
63
56
  response.numero_lote.must_equal '10'
64
57
  response.status.must_equal :success
@@ -71,6 +64,7 @@ describe BrNfe::Service::Simpliss::V1::ConsultaSituacaoLoteRps do
71
64
  subject.request
72
65
  response = subject.response
73
66
 
67
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
74
68
  response.situation.must_equal :error
75
69
  response.numero_lote.must_equal '13'
76
70
  response.status.must_equal :success
@@ -83,6 +77,7 @@ describe BrNfe::Service::Simpliss::V1::ConsultaSituacaoLoteRps do
83
77
  subject.request
84
78
  response = subject.response
85
79
 
80
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
86
81
  response.situation.must_equal :unprocessed
87
82
  response.numero_lote.must_equal '11'
88
83
  response.status.must_equal :success
@@ -95,6 +90,7 @@ describe BrNfe::Service::Simpliss::V1::ConsultaSituacaoLoteRps do
95
90
  subject.request
96
91
  response = subject.response
97
92
 
93
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
98
94
  response.situation.must_equal :unreceived
99
95
  response.numero_lote.must_equal '12'
100
96
  response.status.must_equal :success
@@ -108,9 +104,9 @@ describe BrNfe::Service::Simpliss::V1::ConsultaSituacaoLoteRps do
108
104
  subject.request
109
105
  response = subject.response
110
106
 
111
- response.protocolo.must_be_nil
112
- response.data_recebimento.must_be_nil
107
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
113
108
  response.numero_lote.must_be_nil
109
+ response.situation.must_equal :error
114
110
  response.status.must_equal :falied
115
111
  response.error_messages.size.must_equal 1
116
112
  response.error_messages[0][:code].must_equal 'E900'
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Simpliss::V1::RecepcaoLoteRps do
4
4
  subject { FactoryGirl.build(:service_simpliss_v1_recepcao_lote_rps, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
 
7
7
  describe "superclass" do
8
8
  it { subject.class.superclass.must_equal BrNfe::Service::Simpliss::V1::Base }
@@ -16,14 +16,6 @@ describe BrNfe::Service::Simpliss::V1::RecepcaoLoteRps do
16
16
  it { subject.method_wsdl.must_equal :recepcionar_lote_rps }
17
17
  end
18
18
 
19
- it "#response_root_path" do
20
- subject.response_root_path.must_equal [:recepcionar_lote_rps_response]
21
- end
22
-
23
- it "#body_xml_path" do
24
- subject.body_xml_path.must_equal []
25
- end
26
-
27
19
  it "#soap_body_root_tag" do
28
20
  subject.soap_body_root_tag.must_equal 'RecepcionarLoteRps'
29
21
  end
@@ -76,6 +68,7 @@ describe BrNfe::Service::Simpliss::V1::RecepcaoLoteRps do
76
68
  subject.request
77
69
  response = subject.response
78
70
 
71
+ response.must_be_kind_of BrNfe::Service::Response::RecepcaoLoteRps
79
72
  response.protocolo.must_equal '128277'
80
73
  response.data_recebimento.must_equal Time.parse('2016-07-28T16:17:18.4043985-03:00')
81
74
  response.numero_lote.must_equal '10'
@@ -90,6 +83,7 @@ describe BrNfe::Service::Simpliss::V1::RecepcaoLoteRps do
90
83
  subject.request
91
84
  response = subject.response
92
85
 
86
+ response.must_be_kind_of BrNfe::Service::Response::RecepcaoLoteRps
93
87
  response.protocolo.must_be_nil
94
88
  response.data_recebimento.must_be_nil
95
89
  response.numero_lote.must_be_nil
@@ -3,7 +3,7 @@ require 'test_helper'
3
3
  describe BrNfe::Service::Thema::V1::Base do
4
4
  subject { FactoryGirl.build(:service_thema_v1_base, emitente: emitente) }
5
5
  let(:rps) { FactoryGirl.build(:br_nfe_rps, :completo) }
6
- let(:emitente) { FactoryGirl.build(:emitente) }
6
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
7
7
  let(:intermediario) { FactoryGirl.build(:intermediario) }
8
8
 
9
9
  describe "inheritance class" do
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Thema::V1::CancelaNfse do
4
4
  subject { FactoryGirl.build(:service_thema_v1_cancela_nfse, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
 
7
7
  describe "superclass" do
8
8
  it { subject.class.superclass.must_equal BrNfe::Service::Thema::V1::Base }
@@ -37,14 +37,6 @@ describe BrNfe::Service::Thema::V1::CancelaNfse do
37
37
  end
38
38
  end
39
39
 
40
- it "#response_root_path" do
41
- subject.response_root_path.must_equal []
42
- end
43
-
44
- it "#body_xml_path" do
45
- subject.body_xml_path.must_equal [:cancelar_nfse_response, :return]
46
- end
47
-
48
40
  it "#soap_body_root_tag" do
49
41
  subject.soap_body_root_tag.must_equal 'cancelarNfse'
50
42
  end
@@ -79,7 +71,11 @@ describe BrNfe::Service::Thema::V1::CancelaNfse do
79
71
  subject.request
80
72
  response = subject.response
81
73
 
82
- response.cancelation_date_time.must_equal Time.parse('2016-08-15T13:50:31.016Z')
74
+ response.must_be_kind_of BrNfe::Service::Response::Cancelamento
75
+ response.data_hora_cancelamento.must_equal Time.parse('2016-08-15T13:50:31.016Z')
76
+ response.codigo_cancelamento.must_equal 'E506'
77
+ response.numero_nfs.must_equal '201600000000005'
78
+
83
79
  response.status.must_equal :success
84
80
  response.successful_request?.must_equal true
85
81
  end
@@ -91,10 +87,7 @@ describe BrNfe::Service::Thema::V1::CancelaNfse do
91
87
  subject.request
92
88
  response = subject.response
93
89
 
94
- response.protocolo.must_be_nil
95
- response.data_recebimento.must_be_nil
96
- response.numero_lote.must_be_nil
97
- response.cancelation_date_time.must_be_nil
90
+ response.data_hora_cancelamento.must_be_nil
98
91
 
99
92
  response.status.must_equal :falied
100
93
 
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Thema::V1::ConsultaLoteRps do
4
4
  subject { FactoryGirl.build(:service_thema_v1_consulta_lote_rps, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
 
7
7
  it { must validate_presence_of(:protocolo) }
8
8
 
@@ -14,14 +14,6 @@ describe BrNfe::Service::Thema::V1::ConsultaLoteRps do
14
14
  it { subject.method_wsdl.must_equal :consultar_lote_rps }
15
15
  end
16
16
 
17
- it "#response_root_path" do
18
- subject.response_root_path.must_equal []
19
- end
20
-
21
- it "#body_xml_path" do
22
- subject.body_xml_path.must_equal [:consultar_lote_rps_response, :return]
23
- end
24
-
25
17
  it "#soap_body_root_tag" do
26
18
  subject.soap_body_root_tag.must_equal 'consultarLoteRps'
27
19
  end
@@ -73,9 +65,6 @@ describe BrNfe::Service::Thema::V1::ConsultaLoteRps do
73
65
  subject.request
74
66
  response = subject.response
75
67
 
76
- response.protocolo.must_be_nil
77
- response.data_recebimento.must_be_nil
78
- response.numero_lote.must_be_nil
79
68
  response.status.must_equal :falied
80
69
  response.error_messages.size.must_equal 1
81
70
  response.error_messages[0][:code].must_equal 'E86'
@@ -114,13 +103,13 @@ describe BrNfe::Service::Thema::V1::ConsultaLoteRps do
114
103
  nf.cnae_code.must_equal '6202300'
115
104
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
116
105
  nf.codigo_municipio.must_equal '4204202'
117
- nf.total_services.must_equal '1700'
118
- nf.iss_retained.must_equal '2'
106
+ nf.valor_total_servicos.must_equal '1700'
107
+ nf.iss_retido.must_equal '2'
119
108
  nf.total_iss.must_equal '33.72'
120
- nf.base_calculation.must_equal '1685.88'
121
- nf.iss_tax_rate.must_equal '0.02'
109
+ nf.base_calculo.must_equal '1685.88'
110
+ nf.iss_aliquota.must_equal '0.02'
122
111
  nf.valor_liquido.must_equal '1663.02'
123
- nf.deductions.must_equal '7'
112
+ nf.deducoes.must_equal '7'
124
113
  nf.valor_pis.must_equal '1.12'
125
114
  nf.valor_cofins.must_equal '2.12'
126
115
  nf.valor_inss.must_equal '3.12'
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Thema::V1::ConsultaNfsPorRps do
4
4
  subject { FactoryGirl.build(:service_thema_v1_consulta_nfs_por_rps, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
  let(:rps) { subject.rps }
7
7
 
8
8
  describe "superclass" do
@@ -17,13 +17,6 @@ describe BrNfe::Service::Thema::V1::ConsultaNfsPorRps do
17
17
  it { subject.method_wsdl.must_equal :consultar_nfse_por_rps }
18
18
  end
19
19
 
20
- it "#response_root_path" do
21
- subject.response_root_path.must_equal []
22
- end
23
- it "#body_xml_path" do
24
- subject.body_xml_path.must_equal [:consultar_nfse_por_rps_response, :return]
25
- end
26
-
27
20
  it "#soap_body_root_tag" do
28
21
  subject.soap_body_root_tag.must_equal 'consultarNfsePorRps'
29
22
  end
@@ -113,13 +106,13 @@ describe BrNfe::Service::Thema::V1::ConsultaNfsPorRps do
113
106
  nf.cnae_code.must_equal '6202300'
114
107
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
115
108
  nf.codigo_municipio.must_equal '4204202'
116
- nf.total_services.must_equal '1700'
117
- nf.iss_retained.must_equal '2'
109
+ nf.valor_total_servicos.must_equal '1700'
110
+ nf.iss_retido.must_equal '2'
118
111
  nf.total_iss.must_equal '33.72'
119
- nf.base_calculation.must_equal '1685.88'
120
- nf.iss_tax_rate.must_equal '0.02'
112
+ nf.base_calculo.must_equal '1685.88'
113
+ nf.iss_aliquota.must_equal '0.02'
121
114
  nf.valor_liquido.must_equal '1663.02'
122
- nf.deductions.must_equal '7'
115
+ nf.deducoes.must_equal '7'
123
116
  nf.valor_pis.must_equal '1.12'
124
117
  nf.valor_cofins.must_equal '2.12'
125
118
  nf.valor_inss.must_equal '3.12'
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Thema::V1::ConsultaNfse do
4
4
  subject { FactoryGirl.build(:service_thema_v1_consulta_nfse, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
  let(:rps) { subject.rps }
7
7
 
8
8
  describe "superclass" do
@@ -17,13 +17,6 @@ describe BrNfe::Service::Thema::V1::ConsultaNfse do
17
17
  it { subject.method_wsdl.must_equal :consultar_nfse }
18
18
  end
19
19
 
20
- it "#response_root_path" do
21
- subject.response_root_path.must_equal []
22
- end
23
- it "#body_xml_path" do
24
- subject.body_xml_path.must_equal [:consultar_nfse_response, :return]
25
- end
26
-
27
20
  it "#soap_body_root_tag" do
28
21
  subject.soap_body_root_tag.must_equal 'consultarNfse'
29
22
  end
@@ -128,13 +121,13 @@ describe BrNfe::Service::Thema::V1::ConsultaNfse do
128
121
  nf.cnae_code.must_equal '6202300'
129
122
  nf.description.must_equal 'SERVICO DE COMINICACAO WEB DIGITAL 1.700,00'
130
123
  nf.codigo_municipio.must_equal '4204202'
131
- nf.total_services.must_equal '10'
132
- nf.iss_retained.must_equal '2'
124
+ nf.valor_total_servicos.must_equal '10'
125
+ nf.iss_retido.must_equal '2'
133
126
  nf.total_iss.must_equal '0.2'
134
- nf.base_calculation.must_equal '10'
135
- nf.iss_tax_rate.must_equal '0.035'
127
+ nf.base_calculo.must_equal '10'
128
+ nf.iss_aliquota.must_equal '0.035'
136
129
  nf.valor_liquido.must_equal '10'
137
- nf.deductions.must_equal '0'
130
+ nf.deducoes.must_equal '0'
138
131
  nf.valor_pis.must_equal '0'
139
132
  nf.valor_cofins.must_equal '0'
140
133
  nf.valor_inss.must_equal '0'
@@ -196,13 +189,13 @@ describe BrNfe::Service::Thema::V1::ConsultaNfse do
196
189
  nf.cnae_code.must_equal '6202300'
197
190
  nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
198
191
  nf.codigo_municipio.must_equal '4204202'
199
- nf.total_services.must_equal '1700'
200
- nf.iss_retained.must_equal '2'
192
+ nf.valor_total_servicos.must_equal '1700'
193
+ nf.iss_retido.must_equal '2'
201
194
  nf.total_iss.must_equal '33.72'
202
- nf.base_calculation.must_equal '1685.88'
203
- nf.iss_tax_rate.must_equal '0.02'
195
+ nf.base_calculo.must_equal '1685.88'
196
+ nf.iss_aliquota.must_equal '0.02'
204
197
  nf.valor_liquido.must_equal '1663.02'
205
- nf.deductions.must_equal '7'
198
+ nf.deducoes.must_equal '7'
206
199
  nf.valor_pis.must_equal '1.12'
207
200
  nf.valor_cofins.must_equal '2.12'
208
201
  nf.valor_inss.must_equal '3.12'
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Thema::V1::ConsultaSituacaoLoteRps do
4
4
  subject { FactoryGirl.build(:service_thema_v1_consulta_situacao_lote_rps, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente) }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente) }
6
6
 
7
7
  it { must validate_presence_of(:protocolo) }
8
8
 
@@ -14,14 +14,6 @@ describe BrNfe::Service::Thema::V1::ConsultaSituacaoLoteRps do
14
14
  it { subject.method_wsdl.must_equal :consultar_situacao_lote_rps }
15
15
  end
16
16
 
17
- it "#response_root_path" do
18
- subject.response_root_path.must_equal []
19
- end
20
-
21
- it "#body_xml_path" do
22
- subject.body_xml_path.must_equal [:consultar_situacao_lote_rps_response, :return]
23
- end
24
-
25
17
  it "#soap_body_root_tag" do
26
18
  subject.soap_body_root_tag.must_equal 'consultarSituacaoLoteRps'
27
19
  end
@@ -72,6 +64,7 @@ describe BrNfe::Service::Thema::V1::ConsultaSituacaoLoteRps do
72
64
  subject.request
73
65
  response = subject.response
74
66
 
67
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
75
68
  response.situation.must_equal :success, "#{response.inspect}"
76
69
  response.numero_lote.must_equal '11'
77
70
  response.status.must_equal :success
@@ -84,6 +77,7 @@ describe BrNfe::Service::Thema::V1::ConsultaSituacaoLoteRps do
84
77
  subject.request
85
78
  response = subject.response
86
79
 
80
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
87
81
  response.situation.must_equal :error
88
82
  response.numero_lote.must_equal '11'
89
83
  response.status.must_equal :success
@@ -96,6 +90,7 @@ describe BrNfe::Service::Thema::V1::ConsultaSituacaoLoteRps do
96
90
  subject.request
97
91
  response = subject.response
98
92
 
93
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
99
94
  response.situation.must_equal :unprocessed
100
95
  response.numero_lote.must_equal '11'
101
96
  response.status.must_equal :success
@@ -108,6 +103,7 @@ describe BrNfe::Service::Thema::V1::ConsultaSituacaoLoteRps do
108
103
  subject.request
109
104
  response = subject.response
110
105
 
106
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
111
107
  response.situation.must_equal :unreceived
112
108
  response.numero_lote.must_equal '0'
113
109
  response.status.must_equal :falied
@@ -126,8 +122,8 @@ describe BrNfe::Service::Thema::V1::ConsultaSituacaoLoteRps do
126
122
  subject.request
127
123
  response = subject.response
128
124
 
129
- response.protocolo.must_be_nil
130
- response.data_recebimento.must_be_nil
125
+ response.must_be_kind_of BrNfe::Service::Response::ConsultaSituacaoLoteRps
126
+ response.situation.must_equal :error
131
127
  response.numero_lote.must_be_nil
132
128
  response.status.must_equal :falied
133
129
  response.error_messages.size.must_equal 1
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Service::Thema::V1::RecepcaoLoteRpsLimitado do
4
4
  subject { FactoryGirl.build(:service_thema_v1_recepcao_lote_rps_limitado, emitente: emitente) }
5
- let(:emitente) { FactoryGirl.build(:emitente, natureza_operacao: '50') }
5
+ let(:emitente) { FactoryGirl.build(:service_emitente, natureza_operacao: '50') }
6
6
 
7
7
  describe "superclass" do
8
8
  it { subject.class.superclass.must_equal BrNfe::Service::Thema::V1::RecepcaoLoteRps }
@@ -12,10 +12,6 @@ describe BrNfe::Service::Thema::V1::RecepcaoLoteRpsLimitado do
12
12
  it { subject.method_wsdl.must_equal :recepcionar_lote_rps_limitado }
13
13
  end
14
14
 
15
- it "#body_xml_path" do
16
- subject.body_xml_path.must_equal [:recepcionar_lote_rps_limitado_response, :return]
17
- end
18
-
19
15
  it "#soap_body_root_tag" do
20
16
  subject.soap_body_root_tag.must_equal 'recepcionarLoteRpsLimitado'
21
17
  end