spec/reckon/app_spec.rb in reckon-0.5.1 vs spec/reckon/app_spec.rb in reckon-0.5.2

- old
+ new

@@ -119,9 +119,25 @@ expect(rows[1][:pretty_date]).to eq('2012-03-23') expect(rows[1][:pretty_money]).to eq('-$10.00') 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 CHECK,20091224120000[0:GMT],"Book Store",-20.00 DEBIT,20091224120000[0:GMT],"GITHUB 041287430274 CA 12/22GITHUB 04",-7.00