Skip to content

Commit

Permalink
Regression test for #51.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Prew committed Mar 7, 2020
1 parent 2732b8f commit 6ccc535
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/data_fixtures/51-sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
01/09/2015,05354 SUBWAY,8.19,,1000.00
02/18/2015,WENDY'S #6338,8.55,,1000.00
02/25/2015,WENDY'S #6338,8.55,,1000.00
02/25/2015,WENDY'S #6338,9.14,,1000.00
02/27/2015,WENDY'S #6338,5.85,,1000.00
03/09/2015,WENDY'S #6338,17.70,,1000.00
03/16/2015,WENDY'S #6338,11.15,,1000.00
03/23/2015,WENDY'S,10.12,,1000.00
9 changes: 9 additions & 0 deletions spec/data_fixtures/51-tokens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Expenses:
Dining:
Coffee:
- 'STARBUCKS'
- 'TIM HORTON'
Resturant:
- 'WENDY''S'
- 'SUBWAY'
- 'BARAKAT'
16 changes: 16 additions & 0 deletions spec/reckon/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@
end
end

context 'Issue #51 - regression test' do
it 'should assign correct accounts with tokens' do
output = StringIO.new
Reckon::App.new(
file: fixture_path('51-sample.csv'),
unattended: true,
account_tokens_file: fixture_path('51-tokens.yml'),
ignore_columns: [5],
bank_account: 'Assets:Chequing',
output_file: output
).walk_backwards
expect(output.string).not_to include('Income:Unknown')
expect(output.string.scan('Expenses:Dining:Resturant').size).to eq(8)
end
end

#DATA
BANK_CSV = (<<-CSV).strip
DEBIT,20091224120000[0:GMT],"HOST 037196321563 MO 12/22SLICEHOST",-85.00
Expand Down

0 comments on commit 6ccc535

Please sign in to comment.