rnfse 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -6
- data/lib/provedores.yml +8 -0
- data/lib/rnfse.rb +5 -1
- data/lib/rnfse/api.rb +44 -22
- data/lib/rnfse/api/abrasf_1_0.rb +100 -17
- data/lib/rnfse/api/abrasf_1_0/#definitions.json# +413 -0
- data/lib/rnfse/api/abrasf_1_0/cancelar_nfse.json +13 -0
- data/lib/rnfse/api/abrasf_1_0/consultar_nfse.json +17 -0
- data/lib/rnfse/api/abrasf_1_0/consultar_nfse_por_rps.json +13 -0
- data/lib/rnfse/api/abrasf_1_0/definitions.json +27 -3
- data/lib/rnfse/api/abrasf_1_0/recepcionar_lote_rps.json +1 -1
- data/lib/rnfse/api/iss_net_1_0.rb +46 -2
- data/lib/rnfse/api/speed_gov_1_0.rb +115 -0
- data/lib/rnfse/call_chain.rb +4 -4
- data/lib/rnfse/error.rb +15 -0
- data/lib/rnfse/hash.rb +24 -11
- data/lib/rnfse/string.rb +16 -2
- data/lib/rnfse/version.rb +1 -1
- data/lib/rnfse/xml_builder/abrasf_1_0.rb +103 -13
- data/lib/rnfse/xml_builder/iss_net_1_0.rb +34 -4
- data/lib/rnfse/xml_builder/speed_gov_1_0.rb +158 -0
- data/spec/api/abrasf_1_0/cancelar_nfse_json_spec.rb +25 -0
- data/spec/api/abrasf_1_0/consultar_lote_rps_json_spec.rb +23 -0
- data/spec/api/abrasf_1_0/consultar_nfse_json_spec.rb +45 -0
- data/spec/api/abrasf_1_0/consultar_nfse_por_rps_json_spec.rb +23 -0
- data/spec/api/abrasf_1_0/consultar_situacao_lote_rps_json_spec.rb +23 -0
- data/spec/api/abrasf_1_0_spec.rb +185 -6
- data/spec/api/iss_net_1_0_spec.rb +89 -9
- data/spec/api/speed_gov_1_0_spec.rb +243 -0
- data/spec/api_spec.rb +43 -28
- data/spec/error_spec.rb +10 -0
- data/spec/fixtures/abrasf_1_0/cancelar_nfse_envio.xml +16 -0
- data/spec/fixtures/abrasf_1_0/consultar_nfse.xml +23 -0
- data/spec/fixtures/abrasf_1_0/consultar_nfse_por_rps.xml +14 -0
- data/spec/fixtures/iss_net_1_0/cancelar_nfse_envio.xml +17 -0
- data/spec/fixtures/iss_net_1_0/consultar_nfse.xml +29 -0
- data/spec/fixtures/iss_net_1_0/consultar_nfse_por_rps.xml +17 -0
- data/spec/fixtures/speed_gov_1_0/consultar_nfse_envio.xml +29 -0
- data/spec/fixtures/speed_gov_1_0/consultar_nfse_rps_envio.xml +16 -0
- data/spec/fixtures/speed_gov_1_0/consultar_situacao_lote_rps_envio.xml +12 -0
- data/spec/fixtures/speed_gov_1_0/enviar_lote_rps_envio.xml +82 -0
- data/spec/fixtures/speed_gov_1_0/header.xml +9 -0
- data/spec/fixtures/vcr_cassettes/iss_net_1_0_cancelar_nfse.yml +107 -0
- data/spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_nfse.yml +7937 -0
- data/spec/fixtures/vcr_cassettes/iss_net_1_0_consultar_nfse_por_rps.yml +242 -0
- data/spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse.yml +60 -0
- data/spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_nfse_por_rps.yml +80 -0
- data/spec/fixtures/vcr_cassettes/speed_gov_1_0_consultar_situacao_lote_rps.yml +77 -0
- data/spec/fixtures/vcr_cassettes/speed_gov_1_0_recepcionar_lote_rps.yml +171 -0
- data/spec/fixtures/vcr_cassettes/speed_gov_1_0_recepcionar_lote_rps_ascii.yml +171 -0
- data/spec/hash_spec.rb +21 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/string_spec.rb +31 -5
- data/spec/xml_builder/abrasf_1_0_spec.rb +110 -43
- data/spec/xml_builder/iss_net_1_0_spec.rb +111 -44
- data/spec/xml_builder/speed_gov_1_0_spec.rb +173 -0
- metadata +86 -37
- data/.gitignore +0 -25
- data/.rspec +0 -1
- data/.travis.yml +0 -14
- data/Gemfile +0 -3
- data/Guardfile +0 -15
- data/Procfile +0 -1
- data/Rakefile +0 -12
- data/rnfse.gemspec +0 -61
- data/spec/fixtures/abrasf_1_0/teste.xml +0 -8
- data/spec/support/.keep +0 -0
@@ -4,52 +4,11 @@ require 'spec_helper'
|
|
4
4
|
describe Rnfse::XMLBuilder::Abrasf10 do
|
5
5
|
|
6
6
|
let(:builder) { Rnfse::XMLBuilder.new(padrao: :abrasf_1_0) }
|
7
|
-
|
8
|
-
|
9
|
-
describe '#build_consultar_situacao_lote_rps_xml' do
|
10
|
-
let(:xml) do
|
11
|
-
Nokogiri::XML(File.read(File.join($ROOT, 'spec', 'fixtures', 'abrasf_1_0',
|
12
|
-
'consultar_situacao_lote_rps_envio.xml')))
|
13
|
-
end
|
14
|
-
|
15
|
-
subject do
|
16
|
-
builder.build_consultar_situacao_lote_rps_xml({
|
17
|
-
prestador: {
|
18
|
-
cnpj: "14.576.582/0001-63",
|
19
|
-
inscricao_municipal: "124762"
|
20
|
-
},
|
21
|
-
protocolo: "db1c3e91-6aea-4450-a3fc-5b6a7fba7dc7"
|
22
|
-
})
|
23
|
-
end
|
24
|
-
|
25
|
-
it { should be_equivalent_to(xml) }
|
26
|
-
it { should be_kind_of(Nokogiri::XML::Document) }
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "#build_consultar_lote_rps_xml" do
|
30
|
-
let(:xml) do
|
31
|
-
Nokogiri::XML(File.read(File.join($ROOT, 'spec', 'fixtures', 'abrasf_1_0',
|
32
|
-
'consultar_lote_rps_envio.xml')))
|
33
|
-
end
|
34
|
-
|
35
|
-
subject do
|
36
|
-
builder.build_consultar_lote_rps_xml({
|
37
|
-
prestador: {
|
38
|
-
cpf: "970.047.311-20",
|
39
|
-
inscricao_municipal: "812005"
|
40
|
-
},
|
41
|
-
protocolo: "5afd8f42-cc1e-4657-9249-8fbc3f133ebf"
|
42
|
-
})
|
43
|
-
end
|
44
|
-
|
45
|
-
it { should be_equivalent_to(xml) }
|
46
|
-
it { should be_kind_of(Nokogiri::XML::Document) }
|
47
|
-
end
|
7
|
+
let(:xml_path) { File.join($ROOT, 'spec', 'fixtures', 'abrasf_1_0') }
|
48
8
|
|
49
9
|
describe "#build_recepcionar_lote_rps_xml" do
|
50
10
|
let(:xml) do
|
51
|
-
Nokogiri::XML(File.read(File.join(
|
52
|
-
'enviar_lote_rps_envio.xml')))
|
11
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'enviar_lote_rps_envio.xml')))
|
53
12
|
end
|
54
13
|
|
55
14
|
subject do
|
@@ -97,4 +56,112 @@ describe Rnfse::XMLBuilder::Abrasf10 do
|
|
97
56
|
it { should be_kind_of(Nokogiri::XML::Document) }
|
98
57
|
end
|
99
58
|
|
59
|
+
describe '#build_consultar_situacao_lote_rps_xml' do
|
60
|
+
let(:xml) do
|
61
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_situacao_lote_rps_envio.xml')))
|
62
|
+
end
|
63
|
+
|
64
|
+
subject do
|
65
|
+
builder.build_consultar_situacao_lote_rps_xml({
|
66
|
+
prestador: {
|
67
|
+
cnpj: "14.576.582/0001-63",
|
68
|
+
inscricao_municipal: "124762"
|
69
|
+
},
|
70
|
+
protocolo: "db1c3e91-6aea-4450-a3fc-5b6a7fba7dc7"
|
71
|
+
})
|
72
|
+
end
|
73
|
+
|
74
|
+
it { should be_equivalent_to(xml) }
|
75
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#build_consultar_nfse_por_rps_xml' do
|
79
|
+
let(:xml) do
|
80
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_nfse_por_rps.xml')))
|
81
|
+
end
|
82
|
+
|
83
|
+
subject do
|
84
|
+
builder.build_consultar_nfse_por_rps_xml({
|
85
|
+
identificacao_rps: { numero: 2, serie: "8", tipo: 1 },
|
86
|
+
prestador: {
|
87
|
+
cnpj: "14.576.582./0001-63",
|
88
|
+
inscricao_municipal: "124762"
|
89
|
+
}
|
90
|
+
})
|
91
|
+
end
|
92
|
+
|
93
|
+
it { should be_equivalent_to(xml) }
|
94
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
95
|
+
end
|
96
|
+
|
97
|
+
describe '#build_consultar_nfse_xml' do
|
98
|
+
let(:xml) do
|
99
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_nfse.xml')))
|
100
|
+
end
|
101
|
+
|
102
|
+
subject do
|
103
|
+
builder.build_consultar_nfse_xml({
|
104
|
+
prestador: {
|
105
|
+
cnpj: '09.255.435/0001-51',
|
106
|
+
inscricao_municipal: '1000017840'
|
107
|
+
},
|
108
|
+
numero_nfse: '93',
|
109
|
+
data_inicial: '2009-08-01',
|
110
|
+
data_final: '2009-08-30',
|
111
|
+
tomador: {
|
112
|
+
cnpj: '38.693.524/0001-88',
|
113
|
+
inscricao_municipal: '812005'
|
114
|
+
},
|
115
|
+
intermediario_servico: {
|
116
|
+
cnpj: '38.693.524/0001-88',
|
117
|
+
razao_social: 'sdfsfsdfsf',
|
118
|
+
inscricao_municipal: '812005'
|
119
|
+
}
|
120
|
+
})
|
121
|
+
end
|
122
|
+
|
123
|
+
it { should be_equivalent_to(xml) }
|
124
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
125
|
+
end
|
126
|
+
|
127
|
+
describe "#build_consultar_lote_rps_xml" do
|
128
|
+
let(:xml) do
|
129
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_lote_rps_envio.xml')))
|
130
|
+
end
|
131
|
+
|
132
|
+
subject do
|
133
|
+
builder.build_consultar_lote_rps_xml({
|
134
|
+
prestador: {
|
135
|
+
cpf: "970.047.311-20",
|
136
|
+
inscricao_municipal: "812005"
|
137
|
+
},
|
138
|
+
protocolo: "5afd8f42-cc1e-4657-9249-8fbc3f133ebf"
|
139
|
+
})
|
140
|
+
end
|
141
|
+
|
142
|
+
it { should be_equivalent_to(xml) }
|
143
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
144
|
+
end
|
145
|
+
|
146
|
+
describe '#build_cancelar_nfse_xml' do
|
147
|
+
let(:xml) do
|
148
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'cancelar_nfse_envio.xml')))
|
149
|
+
end
|
150
|
+
|
151
|
+
subject do
|
152
|
+
builder.build_cancelar_nfse_xml({
|
153
|
+
identificacao_nfse: {
|
154
|
+
numero: 15,
|
155
|
+
cnpj: '02.956.773/0001-71',
|
156
|
+
inscricao_municipal: '1998010',
|
157
|
+
codigo_municipio: '999'
|
158
|
+
},
|
159
|
+
codigo_cancelamento: '5'
|
160
|
+
})
|
161
|
+
end
|
162
|
+
|
163
|
+
it { should be_equivalent_to(xml) }
|
164
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
165
|
+
end
|
166
|
+
|
100
167
|
end
|
@@ -4,53 +4,11 @@ require 'spec_helper'
|
|
4
4
|
describe Rnfse::XMLBuilder::IssNet10 do
|
5
5
|
|
6
6
|
let(:builder) { Rnfse::XMLBuilder.new(padrao: :iss_net_1_0) }
|
7
|
-
|
8
|
-
describe '#build_consultar_situacao_lote_rps_xml' do
|
9
|
-
let(:xml) do
|
10
|
-
Nokogiri::XML(File.read(File.join($ROOT, 'spec', 'fixtures', 'iss_net_1_0',
|
11
|
-
'consultar_situacao_lote_rps_envio.xml')))
|
12
|
-
end
|
13
|
-
|
14
|
-
subject do
|
15
|
-
builder.build_consultar_situacao_lote_rps_xml({
|
16
|
-
prestador: {
|
17
|
-
cnpj: "14.576.582/0001-63",
|
18
|
-
inscricao_municipal: "124762"
|
19
|
-
},
|
20
|
-
protocolo: "db1c3e91-6aea-4450-a3fc-5b6a7fba7dc7"
|
21
|
-
})
|
22
|
-
end
|
23
|
-
|
24
|
-
it { should be_equivalent_to(xml) }
|
25
|
-
it { should be_kind_of(Nokogiri::XML::Document) }
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
describe "#build_consultar_lote_rps_xml" do
|
30
|
-
let(:xml) do
|
31
|
-
Nokogiri::XML(File.read(File.join($ROOT, 'spec', 'fixtures', 'iss_net_1_0',
|
32
|
-
'consultar_lote_rps_envio.xml')))
|
33
|
-
end
|
34
|
-
|
35
|
-
subject do
|
36
|
-
builder.build_consultar_lote_rps_xml({
|
37
|
-
prestador: {
|
38
|
-
cpf: "970.047.311-20",
|
39
|
-
inscricao_municipal: "812005"
|
40
|
-
},
|
41
|
-
protocolo: "5afd8f42-cc1e-4657-9249-8fbc3f133ebf"
|
42
|
-
})
|
43
|
-
end
|
44
|
-
|
45
|
-
it { should be_equivalent_to(xml) }
|
46
|
-
it { should be_kind_of(Nokogiri::XML::Document) }
|
47
|
-
end
|
48
|
-
|
7
|
+
let(:xml_path) { File.join($ROOT, 'spec', 'fixtures', 'iss_net_1_0') }
|
49
8
|
|
50
9
|
describe "#build_recepcionar_lote_rps_xml" do
|
51
10
|
let(:xml) do
|
52
|
-
Nokogiri::XML(File.read(File.join(
|
53
|
-
'enviar_lote_rps_envio.xml')))
|
11
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'enviar_lote_rps_envio.xml')))
|
54
12
|
end
|
55
13
|
|
56
14
|
subject do
|
@@ -121,4 +79,113 @@ describe Rnfse::XMLBuilder::IssNet10 do
|
|
121
79
|
it { should be_kind_of(Nokogiri::XML::Document) }
|
122
80
|
end
|
123
81
|
|
82
|
+
describe '#build_consultar_situacao_lote_rps_xml' do
|
83
|
+
let(:xml) do
|
84
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_situacao_lote_rps_envio.xml')))
|
85
|
+
end
|
86
|
+
|
87
|
+
subject do
|
88
|
+
builder.build_consultar_situacao_lote_rps_xml({
|
89
|
+
prestador: {
|
90
|
+
cnpj: "14.576.582/0001-63",
|
91
|
+
inscricao_municipal: "124762"
|
92
|
+
},
|
93
|
+
protocolo: "db1c3e91-6aea-4450-a3fc-5b6a7fba7dc7"
|
94
|
+
})
|
95
|
+
end
|
96
|
+
|
97
|
+
it { should be_equivalent_to(xml) }
|
98
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
99
|
+
end
|
100
|
+
|
101
|
+
describe '#build_consultar_nfse_por_rps_xml' do
|
102
|
+
let(:xml) do
|
103
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_nfse_por_rps.xml')))
|
104
|
+
end
|
105
|
+
|
106
|
+
subject do
|
107
|
+
builder.build_consultar_nfse_por_rps_xml({
|
108
|
+
identificacao_rps: { numero: 210, serie: "10", tipo: 1 },
|
109
|
+
prestador: {
|
110
|
+
cpf: '970.047.311-20',
|
111
|
+
inscricao_municipal: '812005'
|
112
|
+
}
|
113
|
+
})
|
114
|
+
end
|
115
|
+
|
116
|
+
it { should be_equivalent_to(xml) }
|
117
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
describe '#build_consultar_nfse_xml' do
|
122
|
+
let(:xml) do
|
123
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_nfse.xml')))
|
124
|
+
end
|
125
|
+
|
126
|
+
subject do
|
127
|
+
builder.build_consultar_nfse_xml({
|
128
|
+
prestador: {
|
129
|
+
cnpj: '09.255.435/0001-51',
|
130
|
+
inscricao_municipal: '1000017840'
|
131
|
+
},
|
132
|
+
numero_nfse: '93',
|
133
|
+
data_inicial: '2009-08-01',
|
134
|
+
data_final: '2009-08-30',
|
135
|
+
tomador: {
|
136
|
+
cnpj: '38.693.524/0001-88',
|
137
|
+
inscricao_municipal: '812005'
|
138
|
+
},
|
139
|
+
intermediario_servico: {
|
140
|
+
cnpj: '38.693.524/0001-88',
|
141
|
+
razao_social: 'sdfsfsdfsf',
|
142
|
+
inscricao_municipal: '812005'
|
143
|
+
}
|
144
|
+
})
|
145
|
+
end
|
146
|
+
|
147
|
+
it { should be_equivalent_to(xml) }
|
148
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
149
|
+
end
|
150
|
+
|
151
|
+
describe '#build_consultar_lote_rps_xml' do
|
152
|
+
let(:xml) do
|
153
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_lote_rps_envio.xml')))
|
154
|
+
end
|
155
|
+
|
156
|
+
subject do
|
157
|
+
builder.build_consultar_lote_rps_xml({
|
158
|
+
prestador: {
|
159
|
+
cpf: "970.047.311-20",
|
160
|
+
inscricao_municipal: "812005"
|
161
|
+
},
|
162
|
+
protocolo: "5afd8f42-cc1e-4657-9249-8fbc3f133ebf"
|
163
|
+
})
|
164
|
+
end
|
165
|
+
|
166
|
+
it { should be_equivalent_to(xml) }
|
167
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
168
|
+
end
|
169
|
+
|
170
|
+
describe '#build_cancelar_nfse_xml' do
|
171
|
+
let(:xml) do
|
172
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'cancelar_nfse_envio.xml')))
|
173
|
+
end
|
174
|
+
|
175
|
+
subject do
|
176
|
+
builder.build_cancelar_nfse_xml({
|
177
|
+
identificacao_nfse: {
|
178
|
+
numero: 15,
|
179
|
+
cnpj: '02.956.773/0001-71',
|
180
|
+
inscricao_municipal: '1998010',
|
181
|
+
codigo_municipio: '999'
|
182
|
+
},
|
183
|
+
codigo_cancelamento: '5'
|
184
|
+
})
|
185
|
+
end
|
186
|
+
|
187
|
+
it { should be_equivalent_to(xml) }
|
188
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
189
|
+
end
|
190
|
+
|
124
191
|
end
|
@@ -0,0 +1,173 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Rnfse::XMLBuilder::IssNet10 do
|
5
|
+
|
6
|
+
let(:builder) { Rnfse::XMLBuilder.new(padrao: :speed_gov_1_0) }
|
7
|
+
let(:xml_path) { File.join($ROOT, 'spec', 'fixtures', 'speed_gov_1_0') }
|
8
|
+
|
9
|
+
describe "#build_recepcionar_lote_rps_xml" do
|
10
|
+
let(:xml) do
|
11
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'enviar_lote_rps_envio.xml')))
|
12
|
+
end
|
13
|
+
|
14
|
+
subject do
|
15
|
+
builder.build_recepcionar_lote_rps_xml({
|
16
|
+
lote_rps: {
|
17
|
+
numero_lote: 1,
|
18
|
+
cnpj: "12.552.510/0001-50",
|
19
|
+
inscricao_municipal: "68",
|
20
|
+
quantidade_rps: 1,
|
21
|
+
lista_rps: [
|
22
|
+
{
|
23
|
+
identificacao_rps: { numero: 1, serie: "00000", tipo: 1 },
|
24
|
+
data_emissao: "2013-10-01T08:10:00",
|
25
|
+
natureza_operacao: 1,
|
26
|
+
optante_simples_nacional: false,
|
27
|
+
incentivador_cultural: false,
|
28
|
+
status: 1,
|
29
|
+
servico: {
|
30
|
+
valores: {
|
31
|
+
valor_servicos: 500.0,
|
32
|
+
valor_deducoes: 0.0,
|
33
|
+
valor_pis: 0.0,
|
34
|
+
valor_cofins: 0.0,
|
35
|
+
valor_inss: 0.0,
|
36
|
+
valor_ir: 0.0,
|
37
|
+
valor_csll: 0.0,
|
38
|
+
iss_retido: false,
|
39
|
+
valor_iss: 10.0,
|
40
|
+
valor_iss_retido: 0.0,
|
41
|
+
outras_retencoes: 0.0,
|
42
|
+
base_calculo: 500.0,
|
43
|
+
aliquota: 0.02,
|
44
|
+
valor_liquido_nfse: 490.0,
|
45
|
+
desconto_condicionado: 0.0,
|
46
|
+
desconto_incondicionado: 0.0
|
47
|
+
},
|
48
|
+
item_lista_servico: "101",
|
49
|
+
codigo_cnae: "6201-5/00",
|
50
|
+
codigo_tributacao_municipio: "620150000",
|
51
|
+
discriminacao: "Borealis",
|
52
|
+
codigo_municipio: 9999999
|
53
|
+
},
|
54
|
+
prestador: {
|
55
|
+
cnpj: "12.552.510/0001-50",
|
56
|
+
inscricao_municipal: "68"
|
57
|
+
},
|
58
|
+
tomador: {
|
59
|
+
identificacao_tomador: {
|
60
|
+
cnpj: "12.477.945/0001-88"
|
61
|
+
},
|
62
|
+
razao_social: 'Black Mesa Research Facility',
|
63
|
+
endereco: {
|
64
|
+
endereco: 'RUA VICENTE F. GOES',
|
65
|
+
numero: '182',
|
66
|
+
complemento: 'A',
|
67
|
+
bairro: 'ALTO DA MANGUEIRA',
|
68
|
+
codigo_municipio: 9999999,
|
69
|
+
uf: 'CE',
|
70
|
+
cep: '61900-000'
|
71
|
+
},
|
72
|
+
contato: {
|
73
|
+
telefone: '8512341234',
|
74
|
+
email: 'teste@fes.com.br'
|
75
|
+
}
|
76
|
+
},
|
77
|
+
intermediario_servico: {
|
78
|
+
razao_social: 'Intersol Servicos Ltda',
|
79
|
+
cpf: '897.461.043-49',
|
80
|
+
inscricao_municipal: '1234567'
|
81
|
+
}
|
82
|
+
}
|
83
|
+
]
|
84
|
+
}
|
85
|
+
})
|
86
|
+
end
|
87
|
+
|
88
|
+
it { should be_equivalent_to(xml) }
|
89
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
90
|
+
end
|
91
|
+
|
92
|
+
describe '#build_consultar_nfse_envio_xml' do
|
93
|
+
let(:xml) do
|
94
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_nfse_envio.xml')))
|
95
|
+
end
|
96
|
+
|
97
|
+
subject do
|
98
|
+
builder.build_consultar_nfse_envio_xml({
|
99
|
+
prestador: {
|
100
|
+
cnpj: "07.792.435/0009-12",
|
101
|
+
inscricao_municipal: "59274734"
|
102
|
+
},
|
103
|
+
numero_nfse: '201400000000001',
|
104
|
+
data_inicial: "2013-04-21T21:42:42-03:00",
|
105
|
+
data_final: "2014-04-21T21:42:42-03:00",
|
106
|
+
tomador: {
|
107
|
+
cnpj: "38.421.846/0001-78",
|
108
|
+
inscricao_municipal: "12345679"
|
109
|
+
},
|
110
|
+
intermediario_servico: {
|
111
|
+
razao_social: "Black Mesa Research Facility",
|
112
|
+
cnpj: "62.894.995/0001-39",
|
113
|
+
inscricao_municipal: "12345670"
|
114
|
+
}
|
115
|
+
})
|
116
|
+
end
|
117
|
+
|
118
|
+
it { should be_equivalent_to(xml) }
|
119
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
120
|
+
end
|
121
|
+
|
122
|
+
describe '#build_consultar_nfse_rps_envio_xml' do
|
123
|
+
let(:xml) do
|
124
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_nfse_rps_envio.xml')))
|
125
|
+
end
|
126
|
+
|
127
|
+
subject do
|
128
|
+
builder.build_consultar_nfse_rps_envio_xml({
|
129
|
+
identificacao_rps: { numero: 1, serie: "00000", tipo: 1 },
|
130
|
+
prestador: {
|
131
|
+
cnpj: "12.552.510/0001-50",
|
132
|
+
inscricao_municipal: "68"
|
133
|
+
}
|
134
|
+
})
|
135
|
+
end
|
136
|
+
|
137
|
+
it { should be_equivalent_to(xml) }
|
138
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
139
|
+
end
|
140
|
+
|
141
|
+
describe '#build_consultar_situacao_lote_rps_envio_xml' do
|
142
|
+
let(:xml) do
|
143
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'consultar_situacao_lote_rps_envio.xml')))
|
144
|
+
end
|
145
|
+
|
146
|
+
subject do
|
147
|
+
builder.build_consultar_situacao_lote_rps_envio_xml({
|
148
|
+
prestador: {
|
149
|
+
cnpj: '07.792.435/0009-12',
|
150
|
+
inscricao_municipal: '59274734'
|
151
|
+
},
|
152
|
+
protocolo: '717293e4-3601-4955-865c-5a022c2b5ff5'
|
153
|
+
})
|
154
|
+
end
|
155
|
+
|
156
|
+
it { should be_equivalent_to(xml) }
|
157
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
158
|
+
end
|
159
|
+
|
160
|
+
describe '#build_header_xml' do
|
161
|
+
let(:xml) do
|
162
|
+
Nokogiri::XML(File.read(File.join(xml_path, 'header.xml')))
|
163
|
+
end
|
164
|
+
|
165
|
+
subject do
|
166
|
+
builder.build_header_xml()
|
167
|
+
end
|
168
|
+
|
169
|
+
it { should be_equivalent_to(xml) }
|
170
|
+
it { should be_kind_of(Nokogiri::XML::Document) }
|
171
|
+
end
|
172
|
+
|
173
|
+
end
|