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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '08d2b3f6258a3edcbfb5b2e7edcd1c44909d2476'
4
- data.tar.gz: 57e642a2dff2d94ffa93fa93b6ed30ca7862c797
3
+ metadata.gz: 4949f38e6085a415b67480155a88e459266b0af0
4
+ data.tar.gz: 00fe2984c26437234b467fa3afb49b9c07aa7559
5
5
  SHA512:
6
- metadata.gz: 3b54fe472f576c2ddf662794fd279df02779750493fe27608bdc07d45d9085e449e6c3cf889a7f113803a1b18972e2ecaac872e03b2b6b0e6e243e2c9103d569
7
- data.tar.gz: bd9ccc9de7cd8dfb2f6bb676945046d78ed7168de51c4ad0b353b59cc4722c8018bdfd9137ab634251f09493a1c9937308175e87e273c07db028f88de7bf0f0e
6
+ metadata.gz: 7f8ea0e2d0d7bb0b20bd56a43ea1cd5f7dafe4d5f3279723d2aa41835ec2be2a96c31c6b22a778c21b194aa334749d1c2a6d75142b14bdc983d0e35fc479dd46
7
+ data.tar.gz: 1166de4ea4b36c0e7f93811cb492ea417edb480684cc5c27eb90359ed27f3e81fab6526cec1f69c756ca17f166faa3fc40d04160947e99488e41b3555ef02f6d
@@ -1,3 +1,7 @@
1
+ ## 0.11.13 - May 30, 2018
2
+
3
+ - Allow 5-digits Australian account numbers
4
+
1
5
  ## 0.11.12 - March 21, 2018
2
6
 
3
7
  - Validate Australian BSBs
@@ -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 6
69
- return {} unless local_details[:account_number].length >= 6
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("-"),
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = "0.11.12".freeze
2
+ VERSION = "0.11.13".freeze
3
3
  end
@@ -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.12
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-03-21 00:00:00.000000000 Z
11
+ date: 2018-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri