ibandit 0.11.12 → 0.11.13
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/lib/ibandit/local_details_cleaner.rb +2 -2
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/iban_spec.rb +36 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4949f38e6085a415b67480155a88e459266b0af0
|
4
|
+
data.tar.gz: 00fe2984c26437234b467fa3afb49b9c07aa7559
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f8ea0e2d0d7bb0b20bd56a43ea1cd5f7dafe4d5f3279723d2aa41835ec2be2a96c31c6b22a778c21b194aa334749d1c2a6d75142b14bdc983d0e35fc479dd46
|
7
|
+
data.tar.gz: 1166de4ea4b36c0e7f93811cb492ea417edb480684cc5c27eb90359ed27f3e81fab6526cec1f69c756ca17f166faa3fc40d04160947e99488e41b3555ef02f6d
|
data/CHANGELOG.md
CHANGED
@@ -65,8 +65,8 @@ module Ibandit
|
|
65
65
|
# Account number may be up to 10 digits long.
|
66
66
|
# Add leading zeros to account number if < 10 digits.
|
67
67
|
#
|
68
|
-
# Minimum account_number length is
|
69
|
-
return {} unless local_details[:account_number].length >=
|
68
|
+
# Minimum account_number length is 5
|
69
|
+
return {} unless local_details[:account_number].length >= 5
|
70
70
|
|
71
71
|
{
|
72
72
|
branch_code: local_details[:branch_code].delete("-"),
|
data/lib/ibandit/version.rb
CHANGED
data/spec/ibandit/iban_spec.rb
CHANGED
@@ -185,6 +185,23 @@ describe Ibandit::IBAN do
|
|
185
185
|
its(:to_s) { is_expected.to eq("") }
|
186
186
|
end
|
187
187
|
|
188
|
+
context "and a 5 digit account number" do
|
189
|
+
let(:account_number) { "12345" }
|
190
|
+
|
191
|
+
its(:country_code) { is_expected.to eq("AU") }
|
192
|
+
its(:bank_code) { is_expected.to be_nil }
|
193
|
+
its(:branch_code) { is_expected.to eq("123456") }
|
194
|
+
its(:account_number) { is_expected.to eq("0000012345") }
|
195
|
+
its(:swift_bank_code) { is_expected.to be_nil }
|
196
|
+
its(:swift_branch_code) { is_expected.to eq("123456") }
|
197
|
+
its(:swift_account_number) { is_expected.to eq("0000012345") }
|
198
|
+
its(:swift_national_id) { is_expected.to eq("123456") }
|
199
|
+
its(:iban) { is_expected.to be_nil }
|
200
|
+
its(:pseudo_iban) { is_expected.to eq("AUZZ1234560000012345") }
|
201
|
+
its(:valid?) { is_expected.to eq(true) }
|
202
|
+
its(:to_s) { is_expected.to eq("") }
|
203
|
+
end
|
204
|
+
|
188
205
|
context "and a 6 digit account number" do
|
189
206
|
let(:account_number) { "123456" }
|
190
207
|
|
@@ -300,6 +317,25 @@ describe Ibandit::IBAN do
|
|
300
317
|
end
|
301
318
|
end
|
302
319
|
|
320
|
+
context "when the input is an account number too short for Australia" do
|
321
|
+
let(:arg) do
|
322
|
+
{
|
323
|
+
country_code: "AU",
|
324
|
+
branch_code: "123456",
|
325
|
+
account_number: "1234",
|
326
|
+
}
|
327
|
+
end
|
328
|
+
|
329
|
+
its(:iban) { is_expected.to be_nil }
|
330
|
+
its(:pseudo_iban) { is_expected.to eq("AUZZ123456______1234") }
|
331
|
+
it "is invalid and has the correct errors" do
|
332
|
+
expect(subject.valid?).to eq(false)
|
333
|
+
expect(subject.errors).to eq(
|
334
|
+
account_number: "is the wrong length (should be 10 characters)",
|
335
|
+
)
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
303
339
|
context "when the input is invalid local details for Australia" do
|
304
340
|
let(:arg) do
|
305
341
|
{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibandit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|