spec/mt940_rabobank_spec.rb in zilverline-mt940-1.0 vs spec/mt940_rabobank_spec.rb in zilverline-mt940-2.0
- old
+ new
@@ -2,11 +2,11 @@
describe "Rabobank" do
context "parse whole file" do
let(:file_name) { File.dirname(__FILE__) + '/fixtures/rabobank.txt' }
- let(:bank_statements) { MT940::Base.parse_mt940(file_name) }
+ let(:bank_statements) { MT940Structured::Parser.parse_mt940(file_name) }
it "should have the correct number of bank account's" do
bank_statements.keys.size.should == 1
end
@@ -153,11 +153,11 @@
end
context "deposit from savings account" do
let(:file_name) { File.dirname(__FILE__) + '/fixtures/rabobank_mt940_structured_to_savings_account.txt' }
- let(:bank_statements) { MT940::Base.parse_mt940(file_name) }
+ let(:bank_statements) { MT940Structured::Parser.parse_mt940(file_name) }
it "should have the correct contra account number" do
bank_statement = bank_statements["123456789"][0]
transaction = bank_statement.transactions.first
transaction.contra_account.should == "1098765432"
@@ -166,44 +166,44 @@
end
context "savings account" do
let(:file_name) { File.dirname(__FILE__) + '/fixtures/rabobank_mt940_structured_savings_account.txt' }
- let(:bank_statements) { MT940::Base.parse_mt940(file_name) }
+ let(:bank_statements) { MT940Structured::Parser.parse_mt940(file_name) }
it "should have the correct accountnumber" do
bank_statements["9123456789"].size.should == 1
end
end
context "structured betalingskenmerk" do
let(:file_name) { File.dirname(__FILE__) + '/fixtures/rabobank_mt940_structured_dutch_tax.txt' }
- let(:bank_statements) { MT940::Base.parse_mt940(file_name) }
+ let(:bank_statements) { MT940Structured::Parser.parse_mt940(file_name) }
it "should put a structuted betalingskenmerk in the description" do
bank_statement = bank_statements["123456789"][0]
transaction = bank_statement.transactions.first
transaction.description.should == "BETALINGSKENMERK 1234567899874563"
end
end
context "structured multiline description" do
let(:file_name) { File.dirname(__FILE__) + '/fixtures/rabobank_mt940_structured_multi_line.txt' }
- let(:bank_statements) { MT940::Base.parse_mt940(file_name) }
+ let(:bank_statements) { MT940Structured::Parser.parse_mt940(file_name) }
it "handles multiline in the description" do
bank_statement = bank_statements["123456789"][0]
transaction = bank_statement.transactions.first
- transaction.description.should == "Factuur 2014-002"
+ transaction.description.should == "Factuur 20 14-002"
end
end
context "mt 940 structured" do
let(:file_name) { File.dirname(__FILE__) + '/fixtures/rabobank_mt940_structured.txt' }
- let(:bank_statements) { MT940::Base.parse_mt940(file_name) }
+ let(:bank_statements) { MT940Structured::Parser.parse_mt940(file_name) }
it "should have the correct number of bank account's" do
bank_statements.keys.size.should == 1
end
@@ -267,11 +267,11 @@
it "should have a contra account iban" do
transaction.contra_account_iban.should == "NL96RBOS0523149468"
end
it "should have a contra account owner" do
- transaction.contra_account_owner.should == "Nespresso Nederland B.V."
+ transaction.contra_account_owner.should == "Nespresso Nede rland B.V."
end
it "should have a bank" do
transaction.bank.should == "Rabobank"
end
@@ -302,11 +302,11 @@
it "should have the correct type" do
transaction.type.should == "Bijschrijving crediteurenbetaling"
end
it "should have the correct contra account" do
- transaction.contra_account.should == "NONREF"
+ transaction.contra_account.should == "663616476"
end
it "should have the correct contra account iban" do
transaction.contra_account_iban.should be_nil
end
@@ -323,11 +323,11 @@
it "should have the correct contra account" do
transaction.contra_account.should == "4500018"
end
it "should have the correct contra account iban" do
- transaction.contra_account_iban.should == "4500018"
+ transaction.contra_account_iban.should == nil
end
it "should have the correct contra account owner" do
transaction.contra_account_owner.should == "DIVV afd parkeergebouwewn"
end
@@ -360,10 +360,10 @@
end
end
it "should be able to handle a debet current balance" do
debet_file_name = File.dirname(__FILE__) + '/fixtures/rabobank_with_debet_previous_balance.txt'
- bank_statement = MT940::Base.parse_mt940(debet_file_name)["129199348"].first
+ bank_statement = MT940Structured::Parser.parse_mt940(debet_file_name)["129199348"].first
bank_statement.previous_balance.amount.should == -12
bank_statement.previous_balance.currency.should == "EUR"
bank_statement.previous_balance.date.should == Date.new(2012, 10, 4)