mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
Issue invoices via admin #2566
This commit is contained in:
parent
4569cc11cd
commit
935c547016
8 changed files with 86 additions and 9 deletions
|
@ -6,15 +6,17 @@ feature 'Invoice', type: :feature do
|
|||
Fabricate(:invoice)
|
||||
end
|
||||
|
||||
it 'should show index of invoices' do
|
||||
before do
|
||||
sign_in @user
|
||||
end
|
||||
|
||||
it 'should show index of invoices' do
|
||||
visit admin_invoices_url
|
||||
i = Invoice.first
|
||||
page.should have_link("Invoice no. #{i.id}")
|
||||
end
|
||||
|
||||
it 'should show invoice' do
|
||||
sign_in @user
|
||||
visit admin_invoices_url
|
||||
i = Invoice.first
|
||||
|
||||
|
@ -23,4 +25,21 @@ feature 'Invoice', type: :feature do
|
|||
page.should have_content("Details")
|
||||
page.should have_content("Paldiski mnt. 123")
|
||||
end
|
||||
|
||||
it 'should issue an invoice' do
|
||||
Fabricate(:eis)
|
||||
r = Fabricate(:registrar)
|
||||
visit admin_invoices_url
|
||||
click_link('Add')
|
||||
page.should have_content('Create new invoice')
|
||||
select r.name, from: 'Registrar'
|
||||
fill_in 'Amount', with: '100'
|
||||
fill_in 'Description', with: 'test issue'
|
||||
click_button 'Add'
|
||||
page.should have_content('Record created')
|
||||
page.should have_content('Invoice no.')
|
||||
page.should have_content('Prepayment')
|
||||
page.should have_content('120.0')
|
||||
page.should have_content(r.name)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue