mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Add bank statement create test #2733
This commit is contained in:
parent
dc8f30f646
commit
4e07941f0c
3 changed files with 54 additions and 2 deletions
|
@ -30,4 +30,4 @@
|
|||
%hr
|
||||
.row
|
||||
.col-md-8.text-right
|
||||
= button_tag(t(:add), class: 'btn btn-warning')
|
||||
= button_tag(t(:save), class: 'btn btn-warning')
|
||||
|
|
52
spec/features/admin/bank_statement_spec.rb
Normal file
52
spec/features/admin/bank_statement_spec.rb
Normal file
|
@ -0,0 +1,52 @@
|
|||
require 'rails_helper'
|
||||
|
||||
feature 'BankStatement', type: :feature do
|
||||
before :all do
|
||||
@user = Fabricate(:admin_user)
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in @user
|
||||
end
|
||||
|
||||
it 'should add a bank statement and transactions manually' do
|
||||
visit admin_bank_statements_url
|
||||
|
||||
click_link 'Add'
|
||||
fill_in 'Bank code', with: '767'
|
||||
fill_in 'Iban', with: 'EE557700771000598731'
|
||||
click_button 'Save'
|
||||
|
||||
page.should have_content('Record created')
|
||||
page.should have_content('Bank statement ')
|
||||
page.should have_content('767')
|
||||
page.should have_content('EE557700771000598731')
|
||||
page.should have_content('Not binded')
|
||||
|
||||
click_link 'Add'
|
||||
fill_in 'Description', with: 'Payment 12345'
|
||||
fill_in 'Sum', with: '120'
|
||||
fill_in 'Reference no', with: 'RF4663930489'
|
||||
fill_in 'Document no', with: '123'
|
||||
fill_in 'Bank reference', with: '767'
|
||||
fill_in 'Iban', with: 'EE557700771000598731'
|
||||
fill_in 'Buyer bank code', with: '767'
|
||||
fill_in 'Buyer iban', with: 'EE557700771000598000'
|
||||
fill_in 'Buyer name', with: 'Test buyer'
|
||||
fill_in 'Paid at', with: '2015-01-01'
|
||||
|
||||
click_button 'Save'
|
||||
|
||||
page.should have_content('Record created')
|
||||
page.should have_content('Bank transaction')
|
||||
page.should have_content('RF4663930489')
|
||||
page.should have_content('EE557700771000598000')
|
||||
page.should have_content('Not binded')
|
||||
page.should have_content('Bind manually')
|
||||
|
||||
click_link 'Back to bank statement'
|
||||
|
||||
page.should have_content('120.0')
|
||||
page.should have_content('Test buyer')
|
||||
end
|
||||
end
|
|
@ -35,7 +35,7 @@ feature 'Invoice', type: :feature do
|
|||
select r.name, from: 'Registrar'
|
||||
fill_in 'Amount', with: '100'
|
||||
fill_in 'Description', with: 'test issue'
|
||||
click_button 'Add'
|
||||
click_button 'Save'
|
||||
page.should have_content('Record created')
|
||||
page.should have_content('Invoice no.')
|
||||
page.should have_content('Prepayment')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue