Skip to content

Commit

Permalink
Add specs for the Parser#sort_csv_file if the transaction belongs to …
Browse files Browse the repository at this point in the history
…others
  • Loading branch information
JanDintel committed Dec 24, 2013
1 parent 300eab6 commit b22fb8e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions spec/factories/api_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ def self.additions
def self.products
[{:datum=>"10-12-2013", :checkin=>"8:00", :vertrek=>"", :checkuit=>"", :bestemming=>"", :bedrag=>"", :transactie=>"Product op kaart gezet", :klasse=>"2", :product=>"Altijd Voordeel (maandabonnement)", :opmerkingen=>""}]
end

def self.unclassified
[{:datum=>"9-12-2013", :checkin=>"7:00", :vertrek=>"", :checkuit=>"", :bestemming=>"", :bedrag=>"", :transactie=>"Foo", :klasse=>"", :product=>"", :opmerkingen=>""}]
end
end
1 change: 1 addition & 0 deletions spec/fixtures/test_transaction_1.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
"11-12-2013";"8:15";"Den Haag Laan van NOI";"";"";"-10,00";"Check-in";"";"";""
"11-12-2013";"8:10";"Leiden Centraal";"";"";"-10,00";"Check-in";"";"";""
"10-12-2013";"8:00";"";"";"";"";"Product op kaart gezet";"2";"Altijd Voordeel (maandabonnement)";""
"9-12-2013";"7:00";"";"";"";"";"Foo";"";"";""
2 changes: 1 addition & 1 deletion spec/lib/ovchipkaart/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let(:forgotten_checkouts) { Factory.forgotten_checkouts }
let(:additions) { Factory.additions }
let(:products) { Factory.products }
let(:unclassified) { [] }
let(:unclassified) { Factory.unclassified }

describe 'public API' do
before { Ovchipkaart::Parser.any_instance.stub(:csv_file).and_return csv_file }
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/ovchipkaart/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
specify { expect(subject.check_ins.count).to eql 5 }
specify { expect(subject.additions.count).to eql 1 }
specify { expect(subject.products.count).to eql 1 }
specify { expect(subject.others.count).to eql 0 }
specify { expect(subject.others.count).to eql 1 }
specify {
expect(subject.forgotten_check_outs.count).to eql 1 }
end
Expand Down

0 comments on commit b22fb8e

Please sign in to comment.