ibandit 0.11.6 → 0.11.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -6
- data/.rubocop_todo.yml +4 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +8 -0
- data/README.md +90 -30
- data/data/structures.yml +9 -0
- data/ibandit.gemspec +23 -19
- data/lib/ibandit.rb +18 -18
- data/lib/ibandit/check_digit.rb +8 -8
- data/lib/ibandit/constants.rb +14 -5
- data/lib/ibandit/german_details_converter.rb +598 -598
- data/lib/ibandit/iban.rb +90 -37
- data/lib/ibandit/iban_assembler.rb +15 -13
- data/lib/ibandit/iban_splitter.rb +4 -4
- data/lib/ibandit/local_details_cleaner.rb +94 -85
- data/lib/ibandit/pseudo_iban_assembler.rb +2 -2
- data/lib/ibandit/pseudo_iban_splitter.rb +15 -25
- data/lib/ibandit/sweden/bank_lookup.rb +1 -1
- data/lib/ibandit/sweden/local_details_converter.rb +7 -7
- data/lib/ibandit/sweden/validator.rb +5 -5
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/german_details_converter_spec.rb +23 -22
- data/spec/ibandit/iban_assembler_spec.rb +310 -310
- data/spec/ibandit/iban_spec.rb +1087 -712
- data/spec/ibandit/iban_splitter_spec.rb +14 -14
- data/spec/ibandit/local_details_cleaner_spec.rb +473 -452
- data/spec/ibandit/pseudo_iban_assembler_spec.rb +54 -18
- data/spec/ibandit/pseudo_iban_splitter_spec.rb +13 -22
- data/spec/ibandit/structure_spec.rb +3 -3
- data/spec/ibandit/sweden/local_details_converter_spec.rb +125 -125
- data/spec/ibandit/sweden/validator_spec.rb +88 -88
- data/spec/spec_helper.rb +10 -10
- metadata +48 -20
@@ -1,37 +1,37 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Ibandit::PseudoIBANAssembler do
|
4
4
|
subject(:pseudo_iban) { described_class.new(local_details).assemble }
|
5
5
|
|
6
|
-
context
|
7
|
-
context
|
6
|
+
context "for Sweden" do
|
7
|
+
context "with valid parameters" do
|
8
8
|
let(:local_details) do
|
9
9
|
{
|
10
|
-
country_code:
|
11
|
-
branch_code:
|
12
|
-
account_number:
|
10
|
+
country_code: "SE",
|
11
|
+
branch_code: "1281",
|
12
|
+
account_number: "0105723",
|
13
13
|
}
|
14
14
|
end
|
15
15
|
|
16
|
-
it { is_expected.to eq(
|
16
|
+
it { is_expected.to eq("SEZZX1281XXX0105723") }
|
17
17
|
end
|
18
18
|
|
19
|
-
context
|
19
|
+
context "without a branch code" do
|
20
20
|
let(:local_details) do
|
21
21
|
{
|
22
|
-
country_code:
|
23
|
-
account_number:
|
22
|
+
country_code: "SE",
|
23
|
+
account_number: "0105723",
|
24
24
|
}
|
25
25
|
end
|
26
26
|
|
27
27
|
it { is_expected.to be_nil }
|
28
28
|
end
|
29
29
|
|
30
|
-
context
|
30
|
+
context "without an account number" do
|
31
31
|
let(:local_details) do
|
32
32
|
{
|
33
|
-
country_code:
|
34
|
-
branch_code:
|
33
|
+
country_code: "SE",
|
34
|
+
branch_code: "1281",
|
35
35
|
}
|
36
36
|
end
|
37
37
|
|
@@ -39,13 +39,49 @@ describe Ibandit::PseudoIBANAssembler do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
context
|
42
|
+
context "for Australia" do
|
43
|
+
context "with valid parameters" do
|
44
|
+
let(:local_details) do
|
45
|
+
{
|
46
|
+
country_code: "AU",
|
47
|
+
branch_code: "123456",
|
48
|
+
account_number: "123456789",
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
it { is_expected.to eq("AUZZ123456123456789") }
|
53
|
+
end
|
54
|
+
|
55
|
+
context "without a branch code" do
|
56
|
+
let(:local_details) do
|
57
|
+
{
|
58
|
+
country_code: "AU",
|
59
|
+
account_number: "123456789",
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
it { is_expected.to be_nil }
|
64
|
+
end
|
65
|
+
|
66
|
+
context "without an account number" do
|
67
|
+
let(:local_details) do
|
68
|
+
{
|
69
|
+
country_code: "AU",
|
70
|
+
branch_code: "123456",
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
it { is_expected.to be_nil }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context "for a country that does not have pseudo-IBANs" do
|
43
79
|
let(:local_details) do
|
44
80
|
{
|
45
|
-
country_code:
|
46
|
-
bank_code:
|
47
|
-
branch_code:
|
48
|
-
account_number:
|
81
|
+
country_code: "GB",
|
82
|
+
bank_code: "WEST",
|
83
|
+
branch_code: "123456",
|
84
|
+
account_number: "98765432",
|
49
85
|
}
|
50
86
|
end
|
51
87
|
|
@@ -1,36 +1,27 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Ibandit::PseudoIBANSplitter do
|
4
4
|
subject(:splitter) { described_class.new(pseudo_iban) }
|
5
5
|
|
6
|
-
describe
|
6
|
+
describe "#split" do
|
7
7
|
subject(:local_details) { splitter.split }
|
8
8
|
|
9
|
-
context
|
10
|
-
let(:pseudo_iban) {
|
9
|
+
context "for a swedish pseudo-IBAN" do
|
10
|
+
let(:pseudo_iban) { "SEZZX1281XXX0105723" }
|
11
11
|
|
12
|
-
its([:country_code]) { is_expected.to eq(
|
12
|
+
its([:country_code]) { is_expected.to eq("SE") }
|
13
13
|
its([:bank_code]) { is_expected.to be_nil }
|
14
|
-
its([:branch_code]) { is_expected.to eq(
|
15
|
-
its([:account_number]) { is_expected.to eq(
|
14
|
+
its([:branch_code]) { is_expected.to eq("1281") }
|
15
|
+
its([:account_number]) { is_expected.to eq("0105723") }
|
16
16
|
end
|
17
17
|
|
18
|
-
context
|
19
|
-
let(:pseudo_iban) {
|
18
|
+
context "for an australian pseudo-IBAN" do
|
19
|
+
let(:pseudo_iban) { "AUZZ123456123456789" }
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
let(:pseudo_iban) { 'SEYYX1281XXX0105723' }
|
26
|
-
|
27
|
-
it { is_expected.to be_nil }
|
28
|
-
end
|
29
|
-
|
30
|
-
context 'with the wrong length' do
|
31
|
-
let(:pseudo_iban) { 'SEYYX1281XXX010572' }
|
32
|
-
|
33
|
-
it { is_expected.to be_nil }
|
21
|
+
its([:country_code]) { is_expected.to eq("AU") }
|
22
|
+
its([:bank_code]) { is_expected.to be_nil }
|
23
|
+
its([:branch_code]) { is_expected.to eq("123456") }
|
24
|
+
its([:account_number]) { is_expected.to eq("123456789") }
|
34
25
|
end
|
35
26
|
end
|
36
27
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
|
-
describe
|
4
|
-
FILE = File.expand_path(
|
3
|
+
describe "structures.yml" do
|
4
|
+
FILE = File.expand_path("../../../data/structures.yml", __FILE__)
|
5
5
|
STRUCTURES = YAML.load_file(FILE)
|
6
6
|
|
7
7
|
STRUCTURES.each do |country, rules|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Ibandit::Sweden::LocalDetailsConverter do
|
4
4
|
subject(:converter) do
|
@@ -8,202 +8,202 @@ describe Ibandit::Sweden::LocalDetailsConverter do
|
|
8
8
|
|
9
9
|
let(:branch_code) { nil }
|
10
10
|
|
11
|
-
describe
|
11
|
+
describe ".convert" do
|
12
12
|
subject { converter.convert }
|
13
13
|
|
14
|
-
context
|
15
|
-
let(:account_number) {
|
14
|
+
context "with a type-1 account number" do
|
15
|
+
let(:account_number) { "12810105723" }
|
16
16
|
|
17
|
-
its([:account_number]) { is_expected.to eq(
|
18
|
-
its([:branch_code]) { is_expected.to eq(
|
19
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
20
|
-
its([:swift_account_number]) { is_expected.to eq(
|
17
|
+
its([:account_number]) { is_expected.to eq("0105723") }
|
18
|
+
its([:branch_code]) { is_expected.to eq("1281") }
|
19
|
+
its([:swift_bank_code]) { is_expected.to eq("120") }
|
20
|
+
its([:swift_account_number]) { is_expected.to eq("00000012810105723") }
|
21
21
|
|
22
|
-
context
|
23
|
-
let(:account_number) {
|
22
|
+
context "that includes hyphens" do
|
23
|
+
let(:account_number) { "1281-0105723" }
|
24
24
|
|
25
|
-
its([:account_number]) { is_expected.to eq(
|
26
|
-
its([:branch_code]) { is_expected.to eq(
|
27
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
28
|
-
its([:swift_account_number]) { is_expected.to eq(
|
25
|
+
its([:account_number]) { is_expected.to eq("0105723") }
|
26
|
+
its([:branch_code]) { is_expected.to eq("1281") }
|
27
|
+
its([:swift_bank_code]) { is_expected.to eq("120") }
|
28
|
+
its([:swift_account_number]) { is_expected.to eq("00000012810105723") }
|
29
29
|
end
|
30
30
|
|
31
|
-
context
|
32
|
-
let(:branch_code) {
|
33
|
-
let(:account_number) {
|
31
|
+
context "with a separate branch code" do
|
32
|
+
let(:branch_code) { "1281" }
|
33
|
+
let(:account_number) { "0105723" }
|
34
34
|
|
35
|
-
its([:account_number]) { is_expected.to eq(
|
36
|
-
its([:branch_code]) { is_expected.to eq(
|
37
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
38
|
-
its([:swift_account_number]) { is_expected.to eq(
|
35
|
+
its([:account_number]) { is_expected.to eq("0105723") }
|
36
|
+
its([:branch_code]) { is_expected.to eq("1281") }
|
37
|
+
its([:swift_bank_code]) { is_expected.to eq("120") }
|
38
|
+
its([:swift_account_number]) { is_expected.to eq("00000012810105723") }
|
39
39
|
end
|
40
40
|
|
41
|
-
context
|
42
|
-
let(:account_number) {
|
41
|
+
context "that includes spaces" do
|
42
|
+
let(:account_number) { "1281 0105723" }
|
43
43
|
|
44
|
-
its([:account_number]) { is_expected.to eq(
|
45
|
-
its([:branch_code]) { is_expected.to eq(
|
46
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
47
|
-
its([:swift_account_number]) { is_expected.to eq(
|
44
|
+
its([:account_number]) { is_expected.to eq("0105723") }
|
45
|
+
its([:branch_code]) { is_expected.to eq("1281") }
|
46
|
+
its([:swift_bank_code]) { is_expected.to eq("120") }
|
47
|
+
its([:swift_account_number]) { is_expected.to eq("00000012810105723") }
|
48
48
|
end
|
49
49
|
|
50
|
-
context
|
51
|
-
let(:account_number) {
|
50
|
+
context "that includes full stops" do
|
51
|
+
let(:account_number) { "1281.010.572.3" }
|
52
52
|
|
53
|
-
its([:account_number]) { is_expected.to eq(
|
54
|
-
its([:branch_code]) { is_expected.to eq(
|
55
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
56
|
-
its([:swift_account_number]) { is_expected.to eq(
|
53
|
+
its([:account_number]) { is_expected.to eq("0105723") }
|
54
|
+
its([:branch_code]) { is_expected.to eq("1281") }
|
55
|
+
its([:swift_bank_code]) { is_expected.to eq("120") }
|
56
|
+
its([:swift_account_number]) { is_expected.to eq("00000012810105723") }
|
57
57
|
end
|
58
58
|
|
59
|
-
context
|
60
|
-
let(:account_number) {
|
59
|
+
context "that needs the account number part to be zero-padded" do
|
60
|
+
let(:account_number) { "1281-1" }
|
61
61
|
|
62
|
-
its([:account_number]) { is_expected.to eq(
|
63
|
-
its([:branch_code]) { is_expected.to eq(
|
64
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
65
|
-
its([:swift_account_number]) { is_expected.to eq(
|
62
|
+
its([:account_number]) { is_expected.to eq("1") }
|
63
|
+
its([:branch_code]) { is_expected.to eq("1281") }
|
64
|
+
its([:swift_bank_code]) { is_expected.to eq("120") }
|
65
|
+
its([:swift_account_number]) { is_expected.to eq("00000000000012811") }
|
66
66
|
end
|
67
67
|
|
68
|
-
context
|
69
|
-
let(:account_number) {
|
68
|
+
context "from SEB" do
|
69
|
+
let(:account_number) { "5439-10 240 39" }
|
70
70
|
|
71
|
-
its([:account_number]) { is_expected.to eq(
|
72
|
-
its([:branch_code]) { is_expected.to eq(
|
73
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
74
|
-
its([:swift_account_number]) { is_expected.to eq(
|
71
|
+
its([:account_number]) { is_expected.to eq("1024039") }
|
72
|
+
its([:branch_code]) { is_expected.to eq("5439") }
|
73
|
+
its([:swift_bank_code]) { is_expected.to eq("500") }
|
74
|
+
its([:swift_account_number]) { is_expected.to eq("00000054391024039") }
|
75
75
|
|
76
|
-
context
|
77
|
-
let(:branch_code) {
|
78
|
-
let(:account_number) {
|
76
|
+
context "with a separate branch code" do
|
77
|
+
let(:branch_code) { "5439" }
|
78
|
+
let(:account_number) { "1024039" }
|
79
79
|
|
80
|
-
its([:account_number]) { is_expected.to eq(
|
81
|
-
its([:branch_code]) { is_expected.to eq(
|
82
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
80
|
+
its([:account_number]) { is_expected.to eq("1024039") }
|
81
|
+
its([:branch_code]) { is_expected.to eq("5439") }
|
82
|
+
its([:swift_bank_code]) { is_expected.to eq("500") }
|
83
83
|
its([:swift_account_number]) do
|
84
|
-
is_expected.to eq(
|
84
|
+
is_expected.to eq("00000054391024039")
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
90
|
context "with a clearing code that doesn't match any banks" do
|
91
|
-
let(:account_number) {
|
91
|
+
let(:account_number) { "1001-1" }
|
92
92
|
|
93
93
|
its([:account_number]) { is_expected.to eq(nil) }
|
94
94
|
its([:branch_code]) { is_expected.to eq(nil) }
|
95
95
|
its([:swift_bank_code]) { is_expected.to eq(nil) }
|
96
|
-
its([:swift_account_number]) { is_expected.to eq(
|
96
|
+
its([:swift_account_number]) { is_expected.to eq("00000000000010011") }
|
97
97
|
end
|
98
98
|
|
99
|
-
context
|
100
|
-
let(:account_number) {
|
99
|
+
context "with a Swedbank clearing code" do
|
100
|
+
let(:account_number) { "7507-1211203" }
|
101
101
|
|
102
|
-
its([:account_number]) { is_expected.to eq(
|
103
|
-
its([:branch_code]) { is_expected.to eq(
|
104
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
105
|
-
its([:swift_account_number]) { is_expected.to eq(
|
102
|
+
its([:account_number]) { is_expected.to eq("1211203") }
|
103
|
+
its([:branch_code]) { is_expected.to eq("7507") }
|
104
|
+
its([:swift_bank_code]) { is_expected.to eq("800") }
|
105
|
+
its([:swift_account_number]) { is_expected.to eq("00000075071211203") }
|
106
106
|
|
107
|
-
context
|
108
|
-
let(:account_number) {
|
107
|
+
context "in the 8000s range" do
|
108
|
+
let(:account_number) { "8327-9 33395390-9" }
|
109
109
|
|
110
|
-
its([:account_number]) { is_expected.to eq(
|
111
|
-
its([:branch_code]) { is_expected.to eq(
|
112
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
113
|
-
its([:swift_account_number]) { is_expected.to eq(
|
110
|
+
its([:account_number]) { is_expected.to eq("0333953909") }
|
111
|
+
its([:branch_code]) { is_expected.to eq("83279") }
|
112
|
+
its([:swift_bank_code]) { is_expected.to eq("800") }
|
113
|
+
its([:swift_account_number]) { is_expected.to eq("00832790333953909") }
|
114
114
|
end
|
115
115
|
|
116
|
-
context
|
117
|
-
let(:account_number) {
|
116
|
+
context "another in the 8000s range" do
|
117
|
+
let(:account_number) { "8201-6 914357963-0" }
|
118
118
|
|
119
|
-
its([:account_number]) { is_expected.to eq(
|
120
|
-
its([:branch_code]) { is_expected.to eq(
|
121
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
122
|
-
its([:swift_account_number]) { is_expected.to eq(
|
119
|
+
its([:account_number]) { is_expected.to eq("9143579630") }
|
120
|
+
its([:branch_code]) { is_expected.to eq("82016") }
|
121
|
+
its([:swift_bank_code]) { is_expected.to eq("800") }
|
122
|
+
its([:swift_account_number]) { is_expected.to eq("00820169143579630") }
|
123
123
|
end
|
124
124
|
|
125
|
-
context
|
126
|
-
let(:branch_code) {
|
127
|
-
let(:account_number) {
|
125
|
+
context "with an explicit branch code" do
|
126
|
+
let(:branch_code) { "8201-6" }
|
127
|
+
let(:account_number) { "914357963-0" }
|
128
128
|
|
129
|
-
its([:account_number]) { is_expected.to eq(
|
130
|
-
its([:branch_code]) { is_expected.to eq(
|
131
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
132
|
-
its([:swift_account_number]) { is_expected.to eq(
|
129
|
+
its([:account_number]) { is_expected.to eq("9143579630") }
|
130
|
+
its([:branch_code]) { is_expected.to eq("82016") }
|
131
|
+
its([:swift_bank_code]) { is_expected.to eq("800") }
|
132
|
+
its([:swift_account_number]) { is_expected.to eq("00820169143579630") }
|
133
133
|
end
|
134
134
|
|
135
|
-
context
|
136
|
-
let(:account_number) {
|
135
|
+
context "in the 8000s range, with a very short input" do
|
136
|
+
let(:account_number) { "8004" }
|
137
137
|
let(:branch_code) { nil }
|
138
138
|
|
139
139
|
its([:account_number]) { is_expected.to be_nil }
|
140
|
-
its([:branch_code]) { is_expected.to eq(
|
141
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
140
|
+
its([:branch_code]) { is_expected.to eq("8004") }
|
141
|
+
its([:swift_bank_code]) { is_expected.to eq("800") }
|
142
142
|
its([:swift_account_number]) { is_expected.to be_nil }
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
|
-
context
|
147
|
-
let(:account_number) {
|
146
|
+
context "with a Sparbanken Öresund clearing code" do
|
147
|
+
let(:account_number) { "9300-35299478" }
|
148
148
|
|
149
|
-
its([:account_number]) { is_expected.to eq(
|
150
|
-
its([:branch_code]) { is_expected.to eq(
|
151
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
152
|
-
its([:swift_account_number]) { is_expected.to eq(
|
149
|
+
its([:account_number]) { is_expected.to eq("35299478") }
|
150
|
+
its([:branch_code]) { is_expected.to eq("9300") }
|
151
|
+
its([:swift_bank_code]) { is_expected.to eq("930") }
|
152
|
+
its([:swift_account_number]) { is_expected.to eq("00000000035299478") }
|
153
153
|
|
154
|
-
context
|
155
|
-
let(:account_number) {
|
154
|
+
context "with clearing number 9330 or above" do
|
155
|
+
let(:account_number) { "9330-5930160535" }
|
156
156
|
|
157
|
-
its([:account_number]) { is_expected.to eq(
|
158
|
-
its([:branch_code]) { is_expected.to eq(
|
159
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
160
|
-
its([:swift_account_number]) { is_expected.to eq(
|
157
|
+
its([:account_number]) { is_expected.to eq("5930160535") }
|
158
|
+
its([:branch_code]) { is_expected.to eq("9330") }
|
159
|
+
its([:swift_bank_code]) { is_expected.to eq("933") }
|
160
|
+
its([:swift_account_number]) { is_expected.to eq("00000005930160535") }
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
164
|
-
context
|
165
|
-
let(:account_number) {
|
164
|
+
context "with a Sparbanken Syd clearing code" do
|
165
|
+
let(:account_number) { "9570-5250093407" }
|
166
166
|
|
167
|
-
its([:account_number]) { is_expected.to eq(
|
168
|
-
its([:branch_code]) { is_expected.to eq(
|
169
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
170
|
-
its([:swift_account_number]) { is_expected.to eq(
|
167
|
+
its([:account_number]) { is_expected.to eq("5250093407") }
|
168
|
+
its([:branch_code]) { is_expected.to eq("9570") }
|
169
|
+
its([:swift_bank_code]) { is_expected.to eq("957") }
|
170
|
+
its([:swift_account_number]) { is_expected.to eq("00000005250093407") }
|
171
171
|
end
|
172
172
|
|
173
|
-
context
|
174
|
-
let(:account_number) {
|
173
|
+
context "with a Handelsbanken clearing code" do
|
174
|
+
let(:account_number) { "6000-806967498" }
|
175
175
|
|
176
|
-
its([:account_number]) { is_expected.to eq(
|
177
|
-
its([:branch_code]) { is_expected.to eq(
|
178
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
179
|
-
its([:swift_account_number]) { is_expected.to eq(
|
176
|
+
its([:account_number]) { is_expected.to eq("806967498") }
|
177
|
+
its([:branch_code]) { is_expected.to eq("6000") }
|
178
|
+
its([:swift_bank_code]) { is_expected.to eq("600") }
|
179
|
+
its([:swift_account_number]) { is_expected.to eq("00000000806967498") }
|
180
180
|
|
181
|
-
context
|
182
|
-
let(:account_number) {
|
181
|
+
context "that has clearing code 6240" do
|
182
|
+
let(:account_number) { "6240-219161038" }
|
183
183
|
|
184
|
-
its([:account_number]) { is_expected.to eq(
|
185
|
-
its([:branch_code]) { is_expected.to eq(
|
186
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
187
|
-
its([:swift_account_number]) { is_expected.to eq(
|
184
|
+
its([:account_number]) { is_expected.to eq("219161038") }
|
185
|
+
its([:branch_code]) { is_expected.to eq("6240") }
|
186
|
+
its([:swift_bank_code]) { is_expected.to eq("600") }
|
187
|
+
its([:swift_account_number]) { is_expected.to eq("00000000219161038") }
|
188
188
|
end
|
189
189
|
|
190
|
-
context
|
191
|
-
let(:account_number) {
|
190
|
+
context "that only has an 8 digit serial number" do
|
191
|
+
let(:account_number) { "6240-21916103" }
|
192
192
|
|
193
|
-
its([:account_number]) { is_expected.to eq(
|
194
|
-
its([:branch_code]) { is_expected.to eq(
|
195
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
196
|
-
its([:swift_account_number]) { is_expected.to eq(
|
193
|
+
its([:account_number]) { is_expected.to eq("021916103") }
|
194
|
+
its([:branch_code]) { is_expected.to eq("6240") }
|
195
|
+
its([:swift_bank_code]) { is_expected.to eq("600") }
|
196
|
+
its([:swift_account_number]) { is_expected.to eq("00000000021916103") }
|
197
197
|
end
|
198
198
|
end
|
199
199
|
|
200
|
-
context
|
201
|
-
let(:account_number) {
|
200
|
+
context "with a Nordea PlusGirot clearing code" do
|
201
|
+
let(:account_number) { "9960-3401258276" }
|
202
202
|
|
203
|
-
its([:account_number]) { is_expected.to eq(
|
204
|
-
its([:branch_code]) { is_expected.to eq(
|
205
|
-
its([:swift_bank_code]) { is_expected.to eq(
|
206
|
-
its([:swift_account_number]) { is_expected.to eq(
|
203
|
+
its([:account_number]) { is_expected.to eq("3401258276") }
|
204
|
+
its([:branch_code]) { is_expected.to eq("9960") }
|
205
|
+
its([:swift_bank_code]) { is_expected.to eq("950") }
|
206
|
+
its([:swift_account_number]) { is_expected.to eq("00099603401258276") }
|
207
207
|
end
|
208
208
|
end
|
209
209
|
end
|