king_dtaus 2.0.0 → 2.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile +1 -5
- data/Gemfile.lock +38 -0
- data/README.rdoc +120 -0
- data/Rakefile +1 -7
- data/VERSION +1 -1
- data/king_dtaus.gemspec +11 -12
- data/lib/king_dta/account.rb +29 -30
- data/lib/king_dta/dta.rb +0 -10
- data/lib/king_dta/dtaus.rb +134 -125
- data/lib/king_dta/dtazv.rb +221 -183
- data/lib/king_dta/helper.rb +1 -3
- data/lib/king_dtaus.rb +0 -1
- data/spec/account_spec.rb +150 -64
- data/spec/booking_spec.rb +3 -1
- data/spec/dtaus_spec.rb +12 -35
- data/spec/dtazv_spec.rb +155 -54
- data/spec/dtazv_test.rb +105 -0
- data/spec/spec_helper.rb +65 -43
- metadata +38 -48
- data/.travis.yml +0 -3
- data/README.markdown +0 -128
- /data/{docs/example.output → example.output} +0 -0
data/spec/account_spec.rb
CHANGED
@@ -5,103 +5,189 @@ describe KingDta::Account do
|
|
5
5
|
|
6
6
|
before :each do
|
7
7
|
@ba = test_kto2 # BankAccount mocked as open struct
|
8
|
+
@dudes_konto = dudes_konto
|
8
9
|
end
|
9
10
|
|
10
11
|
it "should initialize a new account" do
|
11
|
-
lambda{
|
12
|
-
KingDta::Account.new(:bank_account_number => @ba.bank_account_number,
|
13
|
-
:bank_number => @ba.bank_number,
|
14
|
-
:owner_name => @ba.owner_name)
|
15
|
-
}.should_not raise_error
|
12
|
+
lambda{ KingDta::Account.new(:account_number => @ba.account_number, :bank_number => @ba.bank_number, :client_name => @ba.client_name) }.should_not raise_error
|
16
13
|
end
|
17
14
|
|
18
15
|
it "should initialize a new dtazv account" do
|
19
|
-
lambda{
|
20
|
-
|
21
|
-
|
16
|
+
lambda{ KingDta::Account.new(
|
17
|
+
:account_number => @dudes_konto.account_number,
|
18
|
+
:bank_number => @dudes_konto.bank_number,
|
19
|
+
:client_name => @dudes_konto.client_name,
|
20
|
+
:client_number => @dudes_konto.client_number,
|
21
|
+
:bank_street => @dudes_konto.account_street,
|
22
|
+
:bank_city => @dudes_konto.account_city,
|
23
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
24
|
+
:bank_name => @dudes_konto.bank_name,
|
25
|
+
:client_street => @dudes_konto.client_street,
|
26
|
+
:client_city => @dudes_konto.client_city,
|
27
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
28
|
+
)}.should_not raise_error
|
22
29
|
end
|
23
30
|
|
24
31
|
it "should fail if bank account number is invalid" do
|
25
|
-
lambda{
|
26
|
-
|
27
|
-
:bank_number => @ba.bank_number,
|
28
|
-
:owner_name => @ba.owner_name)
|
29
|
-
|
30
|
-
}.should raise_error(ArgumentError, 'Bank account number too long, max 10 allowed')
|
32
|
+
# lambda{ KingDta::Account.new(0, @ba.bank_number, @ba.client_name) }.should raise_error(ArgumentError)
|
33
|
+
lambda{ KingDta::Account.new(:account_number => 123456789011123456789011123456789011123456789011123456789011123456789011, :bank_number => @ba.bank_number, :client_name => @ba.client_name) }.should raise_error(ArgumentError, 'Account number too long, max 35 allowed')
|
31
34
|
end
|
32
35
|
|
33
36
|
it "should fail if bank number is invalid" do
|
34
|
-
lambda{
|
35
|
-
|
36
|
-
:bank_number => 0,
|
37
|
-
:owner_name => @ba.owner_name)
|
38
|
-
}.should raise_error(ArgumentError)
|
39
|
-
|
40
|
-
lambda{
|
41
|
-
KingDta::Account.new( :bank_account_number => @ba.bank_account_number,
|
42
|
-
:bank_number => 123456789101112,
|
43
|
-
:owner_name => @ba.owner_name)
|
44
|
-
}.should raise_error(ArgumentError, 'Bank number too long, max 8 allowed')
|
37
|
+
lambda{ KingDta::Account.new(:account_number => @ba.account_number, :bank_number => 0, :client_name => @ba.client_name) }.should raise_error(ArgumentError)
|
38
|
+
lambda{ KingDta::Account.new(:account_number => @ba.account_number, :bank_number => 123456789101112, :client_name => @ba.client_name) }.should raise_error(ArgumentError, 'Bank number too long, max 11 allowed')
|
45
39
|
end
|
46
40
|
|
47
|
-
it "should fail if
|
48
|
-
lambda{
|
49
|
-
KingDta::Account.new( :bank_account_number => @ba.bank_account_number,
|
50
|
-
:bank_number => @ba.bank_number,
|
51
|
-
:owner_name => @ba.owner_name,
|
52
|
-
:owner_number => 12345678901)
|
53
|
-
}.should raise_error(ArgumentError, 'Owner number too long, max 10 allowed')
|
41
|
+
it "should fail if clent number is too long" do
|
42
|
+
lambda{ KingDta::Account.new(:account_number => @ba.account_number, :bank_number => @ba.bank_number, :client_name => @ba.client_name, :client_number => 12345678901) }.should raise_error(ArgumentError, 'Client number too long, max 10 allowed')
|
54
43
|
end
|
55
44
|
|
56
|
-
it "should fail if street and/or Zip Code is too long" do
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
45
|
+
it "should fail if street and/or Zip Code is too long" do
|
46
|
+
lambda{ KingDta::Account.new(
|
47
|
+
:account_number => @dudes_konto.account_number,
|
48
|
+
:bank_number => @dudes_konto.bank_number,
|
49
|
+
:client_name => @dudes_konto.client_name,
|
50
|
+
:client_number => @dudes_konto.client_number,
|
51
|
+
:bank_street => "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
52
|
+
:bank_city => @dudes_konto.account_city,
|
53
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
54
|
+
:bank_name => @dudes_konto.bank_name,
|
55
|
+
:client_street => @dudes_konto.client_street,
|
56
|
+
:client_city => @dudes_konto.client_city,
|
57
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
58
|
+
)}.should raise_error(ArgumentError, 'Street and/or Zip Code too long, max 35 allowed')
|
61
59
|
end
|
62
60
|
|
63
61
|
it "should fail if city is too long" do
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
62
|
+
lambda{ KingDta::Account.new(
|
63
|
+
:account_number => @dudes_konto.account_number,
|
64
|
+
:bank_number => @dudes_konto.bank_number,
|
65
|
+
:client_name => @dudes_konto.client_name,
|
66
|
+
:client_number => @dudes_konto.client_number,
|
67
|
+
:bank_street => @dudes_konto.account_street,
|
68
|
+
:bank_city => "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
69
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
70
|
+
:bank_name => @dudes_konto.account_bank_name,
|
71
|
+
:client_street => @dudes_konto.client_street,
|
72
|
+
:client_city => @dudes_konto.client_city,
|
73
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
74
|
+
)}.should raise_error(ArgumentError, 'City too long, max 35 allowed')
|
68
75
|
end
|
69
76
|
|
70
77
|
it "should fail if bank name is too long" do
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
78
|
+
lambda{ KingDta::Account.new(
|
79
|
+
:account_number => @dudes_konto.account_number,
|
80
|
+
:bank_number => @dudes_konto.bank_number,
|
81
|
+
:client_name => @dudes_konto.client_name,
|
82
|
+
:client_number => @dudes_konto.client_number,
|
83
|
+
:bank_street => @dudes_konto.account_street,
|
84
|
+
:bank_city => @dudes_konto.account_city,
|
85
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
86
|
+
:bank_name => "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
87
|
+
:client_street => @dudes_konto.client_street,
|
88
|
+
:client_city => @dudes_konto.client_city,
|
89
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
90
|
+
)}.should raise_error(ArgumentError, 'Bank Name too long, max 35 allowed')
|
75
91
|
end
|
76
92
|
|
77
|
-
it "should fail if
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
93
|
+
it "should fail if sender street and/or zipcode is too long" do
|
94
|
+
lambda{ KingDta::Account.new(
|
95
|
+
:account_number => @dudes_konto.account_number,
|
96
|
+
:bank_number => @dudes_konto.bank_number,
|
97
|
+
:client_name => @dudes_konto.client_name,
|
98
|
+
:client_number => @dudes_konto.client_number,
|
99
|
+
:bank_street => @dudes_konto.account_street,
|
100
|
+
:bank_city => @dudes_konto.account_city,
|
101
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
102
|
+
:bank_name => @dudes_konto.bank_name,
|
103
|
+
:client_street => "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
104
|
+
:client_city => @dudes_konto.client_city,
|
105
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
106
|
+
)}.should raise_error(ArgumentError, 'Client Street and/or Zip Code too long, max 35 allowed')
|
82
107
|
end
|
83
108
|
|
84
109
|
it "should fail if city is too long" do
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
110
|
+
lambda{ KingDta::Account.new(
|
111
|
+
:account_number => @dudes_konto.account_number,
|
112
|
+
:bank_number => @dudes_konto.bank_number,
|
113
|
+
:client_name => @dudes_konto.client_name,
|
114
|
+
:client_number => @dudes_konto.client_number,
|
115
|
+
:bank_street => @dudes_konto.account_street,
|
116
|
+
:bank_city => @dudes_konto.account_city,
|
117
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
118
|
+
:bank_name => @dudes_konto.bank_name,
|
119
|
+
:client_street => @dudes_konto.client_street,
|
120
|
+
:client_city => "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
121
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
122
|
+
)}.should raise_error(ArgumentError, 'Client City too long, max 35 allowed')
|
89
123
|
end
|
90
124
|
|
91
125
|
it "should return account street and zip" do
|
92
|
-
|
93
|
-
|
126
|
+
konto = KingDta::Account.new(
|
127
|
+
:account_number => @dudes_konto.account_number,
|
128
|
+
:bank_number => @dudes_konto.bank_number,
|
129
|
+
:client_name => @dudes_konto.client_name,
|
130
|
+
:client_number => @dudes_konto.client_number,
|
131
|
+
:bank_street => @dudes_konto.account_street,
|
132
|
+
:bank_city => @dudes_konto.account_city,
|
133
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
134
|
+
:bank_name => @dudes_konto.bank_name,
|
135
|
+
:client_street => @dudes_konto.client_street,
|
136
|
+
:client_city => @dudes_konto.client_city,
|
137
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
138
|
+
)
|
139
|
+
konto.zip_city.should == "51063 BANK KOELN"
|
94
140
|
end
|
95
141
|
|
96
142
|
it "should return sender street and zip" do
|
97
|
-
|
98
|
-
|
143
|
+
konto = KingDta::Account.new(
|
144
|
+
:account_number => @dudes_konto.account_number,
|
145
|
+
:bank_number => @dudes_konto.bank_number,
|
146
|
+
:client_name => @dudes_konto.client_name,
|
147
|
+
:client_number => @dudes_konto.client_number,
|
148
|
+
:bank_street => @dudes_konto.account_street,
|
149
|
+
:bank_city => @dudes_konto.account_city,
|
150
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
151
|
+
:bank_name => @dudes_konto.bank_name,
|
152
|
+
:client_street => @dudes_konto.client_street,
|
153
|
+
:client_city => @dudes_konto.client_city,
|
154
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
155
|
+
)
|
156
|
+
konto.client_zip_city.should == "51063 MEINE KOELN"
|
157
|
+
end
|
158
|
+
|
159
|
+
it "should return sender name1 - the first 35 characters of a name" do
|
160
|
+
konto = KingDta::Account.new(
|
161
|
+
:account_number => @dudes_konto.account_number,
|
162
|
+
:bank_number => @dudes_konto.bank_number,
|
163
|
+
:client_name => @dudes_konto.client_name,
|
164
|
+
:client_number => @dudes_konto.client_number,
|
165
|
+
:bank_street => @dudes_konto.account_street,
|
166
|
+
:bank_city => @dudes_konto.account_city,
|
167
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
168
|
+
:bank_name => @dudes_konto.bank_name,
|
169
|
+
:client_street => @dudes_konto.client_street,
|
170
|
+
:client_city => @dudes_konto.client_city,
|
171
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
172
|
+
)
|
173
|
+
konto.client_name_1.should == "JAN KUS"
|
99
174
|
end
|
100
175
|
|
101
|
-
it "should
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
176
|
+
it "should return sender name1 - the characters 36 - 70 of a name" do
|
177
|
+
konto = KingDta::Account.new(
|
178
|
+
:account_number => @dudes_konto.account_number,
|
179
|
+
:bank_number => @dudes_konto.bank_number,
|
180
|
+
:client_name => @dudes_konto.client_name,
|
181
|
+
:client_number => @dudes_konto.client_number,
|
182
|
+
:bank_street => @dudes_konto.account_street,
|
183
|
+
:bank_city => @dudes_konto.account_city,
|
184
|
+
:bank_zip_code => @dudes_konto.account_zip_code,
|
185
|
+
:bank_name => @dudes_konto.bank_name,
|
186
|
+
:client_street => @dudes_konto.client_street,
|
187
|
+
:client_city => @dudes_konto.client_city,
|
188
|
+
:client_zip_code => @dudes_konto.client_zip_code
|
189
|
+
)
|
190
|
+
konto.client_name_2.should == nil
|
106
191
|
end
|
107
|
-
|
192
|
+
|
193
|
+
end
|
data/spec/booking_spec.rb
CHANGED
@@ -4,7 +4,9 @@ require 'spec_helper'
|
|
4
4
|
describe KingDta::Booking do
|
5
5
|
|
6
6
|
before :each do
|
7
|
-
|
7
|
+
kto1 = test_kto1
|
8
|
+
kto2 = test_kto2
|
9
|
+
@account = KingDta::Account.new(:account_number => kto2.account_number, :bank_number => kto2.bank_number, :client_name => kto2.client_name, :bank_name => kto2.bank_name )
|
8
10
|
end
|
9
11
|
|
10
12
|
it "should have no rounding error for string" do
|
data/spec/dtaus_spec.rb
CHANGED
@@ -8,9 +8,9 @@ describe KingDta::Dtaus do
|
|
8
8
|
@dtaus_gk = KingDta::Dtaus.new('GK', Date.today)
|
9
9
|
@kto1 = test_kto1
|
10
10
|
@kto2 = test_kto2
|
11
|
-
@dtaus.account = KingDta::Account.new(:
|
12
|
-
@dtaus_gk.account = KingDta::Account.new(:
|
13
|
-
@booking = KingDta::Booking.new(KingDta::Account.new(:
|
11
|
+
@dtaus.account = KingDta::Account.new(:account_number => @kto1.account_number, :bank_number => @kto1.bank_number, :client_name => @kto1.client_name, :bank_name => @kto1.bank_name)
|
12
|
+
@dtaus_gk.account = KingDta::Account.new(:account_number => @kto1.account_number, :bank_number => @kto1.bank_number, :client_name => @kto1.client_name, :bank_name => @kto1.bank_name)
|
13
|
+
@booking = KingDta::Booking.new(KingDta::Account.new(:account_number => @kto2.account_number, :bank_number => @kto2.bank_number, :client_name => @kto2.client_name, :bank_name => @kto2.bank_name), 220.25 )
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should not init without values" do
|
@@ -41,7 +41,7 @@ describe KingDta::Dtaus do
|
|
41
41
|
|
42
42
|
it "should not add a booking if closed" do
|
43
43
|
@dtaus.add(@booking)
|
44
|
-
negative_booking = KingDta::Booking.new(KingDta::Account.new(:
|
44
|
+
negative_booking = KingDta::Booking.new(KingDta::Account.new(:account_number => @kto2.account_number, :bank_number => @kto2.bank_number, :client_name => @kto2.client_name, :bank_name => @kto2.bank_name ), -120.25 )
|
45
45
|
lambda{ @dtaus.add(negative_booking) }.should raise_error(KingDta::Exception)
|
46
46
|
end
|
47
47
|
|
@@ -55,7 +55,7 @@ describe KingDta::Dtaus do
|
|
55
55
|
out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"
|
56
56
|
str.should == out
|
57
57
|
#60-70 kontonummer mit nullen aufgefüllt - hier nicht da ktnr == 10 stellen
|
58
|
-
str[60...70].should == "#{test_kto1.
|
58
|
+
str[60...70].should == "#{test_kto1.account_number}"
|
59
59
|
str.should include(test_kto1.bank_number)
|
60
60
|
end
|
61
61
|
|
@@ -85,31 +85,17 @@ describe KingDta::Dtaus do
|
|
85
85
|
@dtaus.add_c(@booking)
|
86
86
|
str = @dtaus.dta_string
|
87
87
|
str.length.should == 256
|
88
|
-
str.should include(@kto2.
|
88
|
+
str.should include(@kto2.client_name.upcase)
|
89
89
|
out = "0216C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGSALESKING MONATSBEITRAG 08/1 010210 FREELANCER VERSION "
|
90
90
|
str.should == out
|
91
91
|
end
|
92
92
|
|
93
|
-
it "should create c-sektion with long account owner name in extension" do
|
94
|
-
@dtaus.account = KingDta::Account.new(:bank_account_number => @kto1.bank_account_number, :bank_number => @kto1.bank_number,
|
95
|
-
:owner_name => 'A very long name exeeding 27 characters even longer 54 chars', :bank_name => @kto1.bank_name)
|
96
|
-
|
97
|
-
@dtaus.add(@booking)
|
98
|
-
@dtaus.bookings.first.text = 'SalesKing Monatsbeitrag 08/10 Freelancer Version'
|
99
|
-
@dtaus.add_c(@booking)
|
100
|
-
str = @dtaus.dta_string
|
101
|
-
str.length.should == 256
|
102
|
-
str.should include(@kto2.owner_name.upcase)
|
103
|
-
out = "0245C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH A VERY LONG NAME EXEEDING 2SALESKING MONATSBEITRAG 08/1 020210 FREELANCER VERSION 037 CHARACTERS EVEN LONGER 54 "
|
104
|
-
str.should == out
|
105
|
-
end
|
106
|
-
|
107
93
|
it "should create c-sektion with default booking text" do
|
108
94
|
@dtaus.default_text = 'Default verwendungszweck'
|
109
95
|
@dtaus.add_c(@booking)
|
110
96
|
str = @dtaus.dta_string
|
111
97
|
str.length.should == 256
|
112
|
-
str.should include(@kto2.
|
98
|
+
str.should include(@kto2.client_name.upcase)
|
113
99
|
out = "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "
|
114
100
|
str.should == out
|
115
101
|
end
|
@@ -119,8 +105,8 @@ describe KingDta::Dtaus do
|
|
119
105
|
@dtaus.add(@booking)
|
120
106
|
str = @dtaus.create
|
121
107
|
str.length.should == 512
|
122
|
-
str.should include(@kto1.
|
123
|
-
str.should include(@kto2.
|
108
|
+
str.should include(@kto1.client_name.upcase)
|
109
|
+
str.should include(@kto2.client_name.upcase)
|
124
110
|
str.should include(@dtaus.default_text.upcase)
|
125
111
|
out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
|
126
112
|
"0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
|
@@ -128,21 +114,12 @@ describe KingDta::Dtaus do
|
|
128
114
|
str.should == out
|
129
115
|
end
|
130
116
|
|
131
|
-
it "should create whole dta string with long texts exeeding extension" do
|
132
|
-
@dtaus.account = KingDta::Account.new(:bank_account_number => @kto1.bank_account_number, :bank_number => @kto1.bank_number,
|
133
|
-
:owner_name => 'A very long name exeeding 27 characters even longer 54 chars', :bank_name => @kto1.bank_name)
|
134
|
-
@dtaus.add(@booking)
|
135
|
-
@dtaus.bookings.first.text = 'Rgn R-3456-0102220 Monatsbeitrag 08/10 Freelancer Version Vielen Dank Ihre SalesKing GmbH' * 20
|
136
|
-
@dtaus.bookings.first.account.owner_name = 'A very long name exeeding 27 characters even longer 54 chars'
|
137
|
-
str = @dtaus.create ## should not raise error
|
138
|
-
end
|
139
|
-
|
140
117
|
it "should create whole dta string with long booking text in extension" do
|
141
118
|
@dtaus.add(@booking)
|
142
119
|
@dtaus.bookings.first.text = 'Rgn R-3456-0102220 Monatsbeitrag 08/10 Freelancer Version Vielen Dank Ihre SalesKing GmbH'
|
143
120
|
str = @dtaus.create
|
144
121
|
str.length.should == 640
|
145
|
-
str.should include(@kto2.
|
122
|
+
str.should include(@kto2.client_name.upcase)
|
146
123
|
out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
|
147
124
|
"0274C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGRGN R-3456-0102220 MONATSBE1 0302ITRAG 08/10 FREELANCER VERS02ION VIELEN DANK IHRE SALESK 02ING GMBH "+
|
148
125
|
"0128E 0000001000000000000000000000002787777000000000370400440000000022025 "
|
@@ -154,8 +131,8 @@ describe KingDta::Dtaus do
|
|
154
131
|
6.times { @dtaus.add(@booking) }
|
155
132
|
str = @dtaus.create
|
156
133
|
str.length.should == 1792
|
157
|
-
str.should include(@kto1.
|
158
|
-
str.should include(@kto2.
|
134
|
+
str.should include(@kto1.client_name.upcase)
|
135
|
+
str.should include(@kto2.client_name.upcase)
|
159
136
|
str.should include(@dtaus.default_text.upcase)
|
160
137
|
out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
|
161
138
|
"0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
|