br_boleto 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.markdown +23 -17
- data/lib/br_boleto.rb +2 -0
- data/lib/br_boleto/boleto/banco_brasil.rb +24 -15
- data/lib/br_boleto/boleto/santander.rb +8 -2
- data/lib/br_boleto/conta/banco_brasil.rb +254 -56
- data/lib/br_boleto/conta/bradesco.rb +229 -27
- data/lib/br_boleto/conta/caixa.rb +208 -4
- data/lib/br_boleto/conta/cecred.rb +29 -0
- data/lib/br_boleto/conta/itau.rb +482 -87
- data/lib/br_boleto/conta/santander.rb +224 -97
- data/lib/br_boleto/conta/sicoob.rb +39 -24
- data/lib/br_boleto/conta/sicredi.rb +169 -64
- data/lib/br_boleto/conta/unicred.rb +16 -13
- data/lib/br_boleto/helper/default_codes.rb +2123 -54
- data/lib/br_boleto/remessa/cnab240/banco_brasil.rb +12 -6
- data/lib/br_boleto/remessa/cnab240/bradesco.rb +1 -1
- data/lib/br_boleto/remessa/cnab240/helper/segmento_p.rb +1 -1
- data/lib/br_boleto/remessa/cnab240/itau.rb +20 -3
- data/lib/br_boleto/remessa/cnab240/santander.rb +25 -24
- data/lib/br_boleto/remessa/cnab400/caixa.rb +197 -0
- data/lib/br_boleto/remessa/cnab400/santander.rb +32 -27
- data/lib/br_boleto/retorno/base.rb +24 -0
- data/lib/br_boleto/retorno/cnab240/base.rb +6 -2
- data/lib/br_boleto/retorno/cnab240/santander.rb +5 -1
- data/lib/br_boleto/retorno/cnab400/banco_brasil.rb +3 -1
- data/lib/br_boleto/retorno/cnab400/base.rb +2 -1
- data/lib/br_boleto/retorno/cnab400/bradesco.rb +6 -0
- data/lib/br_boleto/retorno/cnab400/caixa.rb +49 -0
- data/lib/br_boleto/retorno/cnab400/itau.rb +5 -1
- data/lib/br_boleto/retorno/cnab400/santander.rb +5 -1
- data/lib/br_boleto/retorno/cnab400/sicoob.rb +1 -0
- data/lib/br_boleto/retorno/cnab400/sicredi.rb +6 -0
- data/lib/br_boleto/retorno/pagamento.rb +50 -4
- data/lib/br_boleto/version.rb +1 -1
- data/test/br_boleto/boleto/santander_test.rb +1 -1
- data/test/br_boleto/boleto/sicredi_test.rb +1 -0
- data/test/br_boleto/conta/banco_brasil_test.rb +157 -0
- data/test/br_boleto/conta/base_test.rb +8 -8
- data/test/br_boleto/conta/bradesco_test.rb +165 -0
- data/test/br_boleto/conta/caixa_test.rb +159 -1
- data/test/br_boleto/conta/cecred_test.rb +22 -0
- data/test/br_boleto/conta/itau_test.rb +346 -3
- data/test/br_boleto/conta/santantader_test.rb +123 -10
- data/test/br_boleto/conta/sicoob_test.rb +8 -0
- data/test/br_boleto/conta/sicredi_test.rb +79 -0
- data/test/br_boleto/conta/unicred_test.rb +7 -7
- data/test/br_boleto/remessa/cnab240/itau_test.rb +1 -1
- data/test/br_boleto/remessa/cnab400/caixa_test.rb +184 -0
- data/test/br_boleto/remessa/cnab400/santander_test.rb +30 -17
- data/test/br_boleto/retorno/cnab240/banco_brasil_test.rb +30 -6
- data/test/br_boleto/retorno/cnab240/base_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/bradesco_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/caixa_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/cecred_test.rb +15 -3
- data/test/br_boleto/retorno/cnab240/itau_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/santander_test.rb +30 -6
- data/test/br_boleto/retorno/cnab240/sicoob_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/sicredi_test.rb +25 -5
- data/test/br_boleto/retorno/cnab240/unicred_test.rb +25 -5
- data/test/br_boleto/retorno/cnab400/bradesco_test.rb +30 -6
- data/test/br_boleto/retorno/cnab400/caixa_test.rb +7 -0
- data/test/br_boleto/retorno/cnab400/itau_test.rb +14 -4
- data/test/br_boleto/retorno/cnab400/sicoob_test.rb +25 -5
- data/test/br_boleto/retorno/cnab400/sicredi_test.rb +10 -2
- data/test/br_boleto/retorno/cnab400/unicred.rb +30 -6
- data/test/br_boleto/retorno/pagamento_test.rb +49 -1
- data/test/factories/remessa/cnab400/caixa.rb +8 -0
- data/test/fixtures/retorno/cnab240/santander.ret +1 -1
- metadata +10 -2
@@ -3,7 +3,11 @@ require 'test_helper'
|
|
3
3
|
|
4
4
|
describe BrBoleto::Retorno::Pagamento do
|
5
5
|
|
6
|
-
subject { FactoryGirl.build(:retorno_pagamento) }
|
6
|
+
subject { FactoryGirl.build(:retorno_pagamento, conta_class: BrBoleto::Conta::Caixa) }
|
7
|
+
let(:conta) { FactoryGirl.build(:conta_caixa) }
|
8
|
+
before do
|
9
|
+
subject.conta = conta
|
10
|
+
end
|
7
11
|
|
8
12
|
describe "atributos que devem ser convertidos para data quando o valor for setado" do
|
9
13
|
describe "#data_vencimento" do
|
@@ -183,4 +187,48 @@ describe BrBoleto::Retorno::Pagamento do
|
|
183
187
|
end
|
184
188
|
end
|
185
189
|
end
|
190
|
+
|
191
|
+
describe '#motivo_ocorrencia' do
|
192
|
+
it "deve pegar o valor concatenado dos motivos de ocorrencia de 1 a 5" do
|
193
|
+
subject.stubs(:motivo_ocorrencia_1).returns('01')
|
194
|
+
subject.stubs(:motivo_ocorrencia_2).returns('02')
|
195
|
+
subject.stubs(:motivo_ocorrencia_3).returns('03')
|
196
|
+
subject.stubs(:motivo_ocorrencia_4).returns('04')
|
197
|
+
subject.stubs(:motivo_ocorrencia_5).returns('05')
|
198
|
+
|
199
|
+
subject.motivo_ocorrencia.must_equal '0102030405'
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
describe "Motivos de ocorrência de 1 a 5" do
|
204
|
+
before do
|
205
|
+
subject.cnab = 240
|
206
|
+
subject.stubs(:codigo_movimento_retorno).returns('MV')
|
207
|
+
end
|
208
|
+
it '#motivo_ocorrencia_1 deve pegar o valor conforme a conta através do attr motivo_ocorrencia_original_1' do
|
209
|
+
subject.motivo_ocorrencia_original_1 = '01'
|
210
|
+
conta.expects(:get_codigo_motivo_ocorrencia).with('01', 'MV', 240).returns('C1')
|
211
|
+
subject.motivo_ocorrencia_1.must_equal 'C1'
|
212
|
+
end
|
213
|
+
it '#motivo_ocorrencia_2 deve pegar o valor conforme a conta através do attr motivo_ocorrencia_original_2' do
|
214
|
+
subject.motivo_ocorrencia_original_2 = '02'
|
215
|
+
conta.expects(:get_codigo_motivo_ocorrencia).with('02', 'MV', 240).returns('C2')
|
216
|
+
subject.motivo_ocorrencia_2.must_equal 'C2'
|
217
|
+
end
|
218
|
+
it '#motivo_ocorrencia_3 deve pegar o valor conforme a conta através do attr motivo_ocorrencia_original_3' do
|
219
|
+
subject.motivo_ocorrencia_original_3 = '03'
|
220
|
+
conta.expects(:get_codigo_motivo_ocorrencia).with('03', 'MV', 240).returns('C3')
|
221
|
+
subject.motivo_ocorrencia_3.must_equal 'C3'
|
222
|
+
end
|
223
|
+
it '#motivo_ocorrencia_4 deve pegar o valor conforme a conta através do attr motivo_ocorrencia_original_4' do
|
224
|
+
subject.motivo_ocorrencia_original_4 = '04'
|
225
|
+
conta.expects(:get_codigo_motivo_ocorrencia).with('04', 'MV', 240).returns('C4')
|
226
|
+
subject.motivo_ocorrencia_4.must_equal 'C4'
|
227
|
+
end
|
228
|
+
it '#motivo_ocorrencia_5 deve pegar o valor conforme a conta através do attr motivo_ocorrencia_original_5' do
|
229
|
+
subject.motivo_ocorrencia_original_5 = '05'
|
230
|
+
conta.expects(:get_codigo_motivo_ocorrencia).with('05', 'MV', 240).returns('C5')
|
231
|
+
subject.motivo_ocorrencia_5.must_equal 'C5'
|
232
|
+
end
|
233
|
+
end
|
186
234
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
03300000 2013021784000186999991234567891 007125577 XPTAVARES S.A BANCO SANTANDER (BRASIL) S/A 228042016 000000040
|
2
2
|
03308241T01 040 2013021784000186007125577 999991234567891 XPTAVARES S.A 0000000028042016
|
3
|
-
0330824300001T 02999991234567891 00000000000012 0505201600000000000102503312340 001000033806987840XUNDA 12345678910000000000002610000000000
|
3
|
+
0330824300001T 02999991234567891 00000000000012 0505201600000000000102503312340 001000033806987840XUNDA 12345678910000000000002610000000000
|
4
4
|
0330824300002U 020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002804201628042016000000000000000000000000000 000
|
5
5
|
0330824300003T 02999991234567891 00000000000022 0505201600000000010587703312340 002013021784000186XUNDA 12345678910000000000002610000000000
|
6
6
|
0330824300004U 020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002804201628042016000000000000000000000000000 000
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: br_boleto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno M. Mergen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/br_boleto/remessa/cnab400/banco_brasil.rb
|
148
148
|
- lib/br_boleto/remessa/cnab400/base.rb
|
149
149
|
- lib/br_boleto/remessa/cnab400/bradesco.rb
|
150
|
+
- lib/br_boleto/remessa/cnab400/caixa.rb
|
150
151
|
- lib/br_boleto/remessa/cnab400/helper/detalhe.rb
|
151
152
|
- lib/br_boleto/remessa/cnab400/helper/header.rb
|
152
153
|
- lib/br_boleto/remessa/cnab400/helper/trailer.rb
|
@@ -171,6 +172,7 @@ files:
|
|
171
172
|
- lib/br_boleto/retorno/cnab400/banco_brasil.rb
|
172
173
|
- lib/br_boleto/retorno/cnab400/base.rb
|
173
174
|
- lib/br_boleto/retorno/cnab400/bradesco.rb
|
175
|
+
- lib/br_boleto/retorno/cnab400/caixa.rb
|
174
176
|
- lib/br_boleto/retorno/cnab400/itau.rb
|
175
177
|
- lib/br_boleto/retorno/cnab400/santander.rb
|
176
178
|
- lib/br_boleto/retorno/cnab400/sicoob.rb
|
@@ -242,6 +244,7 @@ files:
|
|
242
244
|
- test/br_boleto/remessa/cnab400/banco_brasil_test.rb
|
243
245
|
- test/br_boleto/remessa/cnab400/base_test.rb
|
244
246
|
- test/br_boleto/remessa/cnab400/bradesco_test.rb
|
247
|
+
- test/br_boleto/remessa/cnab400/caixa_test.rb
|
245
248
|
- test/br_boleto/remessa/cnab400/itau_test.rb
|
246
249
|
- test/br_boleto/remessa/cnab400/santander_test.rb
|
247
250
|
- test/br_boleto/remessa/cnab400/sicoob_test.rb
|
@@ -262,6 +265,7 @@ files:
|
|
262
265
|
- test/br_boleto/retorno/cnab240/unicred_test.rb
|
263
266
|
- test/br_boleto/retorno/cnab400/banco_brasil_test.rb
|
264
267
|
- test/br_boleto/retorno/cnab400/bradesco_test.rb
|
268
|
+
- test/br_boleto/retorno/cnab400/caixa_test.rb
|
265
269
|
- test/br_boleto/retorno/cnab400/itau_test.rb
|
266
270
|
- test/br_boleto/retorno/cnab400/santander_test.rb
|
267
271
|
- test/br_boleto/retorno/cnab400/sicoob_test.rb
|
@@ -303,6 +307,7 @@ files:
|
|
303
307
|
- test/factories/remessa/cnab400/banco_brasil.rb
|
304
308
|
- test/factories/remessa/cnab400/base.rb
|
305
309
|
- test/factories/remessa/cnab400/bradesco.rb
|
310
|
+
- test/factories/remessa/cnab400/caixa.rb
|
306
311
|
- test/factories/remessa/cnab400/itau.rb
|
307
312
|
- test/factories/remessa/cnab400/santander.rb
|
308
313
|
- test/factories/remessa/cnab400/sicoob.rb
|
@@ -412,6 +417,7 @@ test_files:
|
|
412
417
|
- test/br_boleto/remessa/cnab400/banco_brasil_test.rb
|
413
418
|
- test/br_boleto/remessa/cnab400/base_test.rb
|
414
419
|
- test/br_boleto/remessa/cnab400/bradesco_test.rb
|
420
|
+
- test/br_boleto/remessa/cnab400/caixa_test.rb
|
415
421
|
- test/br_boleto/remessa/cnab400/itau_test.rb
|
416
422
|
- test/br_boleto/remessa/cnab400/santander_test.rb
|
417
423
|
- test/br_boleto/remessa/cnab400/sicoob_test.rb
|
@@ -432,6 +438,7 @@ test_files:
|
|
432
438
|
- test/br_boleto/retorno/cnab240/unicred_test.rb
|
433
439
|
- test/br_boleto/retorno/cnab400/banco_brasil_test.rb
|
434
440
|
- test/br_boleto/retorno/cnab400/bradesco_test.rb
|
441
|
+
- test/br_boleto/retorno/cnab400/caixa_test.rb
|
435
442
|
- test/br_boleto/retorno/cnab400/itau_test.rb
|
436
443
|
- test/br_boleto/retorno/cnab400/santander_test.rb
|
437
444
|
- test/br_boleto/retorno/cnab400/sicoob_test.rb
|
@@ -473,6 +480,7 @@ test_files:
|
|
473
480
|
- test/factories/remessa/cnab400/banco_brasil.rb
|
474
481
|
- test/factories/remessa/cnab400/base.rb
|
475
482
|
- test/factories/remessa/cnab400/bradesco.rb
|
483
|
+
- test/factories/remessa/cnab400/caixa.rb
|
476
484
|
- test/factories/remessa/cnab400/itau.rb
|
477
485
|
- test/factories/remessa/cnab400/santander.rb
|
478
486
|
- test/factories/remessa/cnab400/sicoob.rb
|