mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Add some tests in invoices
This commit is contained in:
parent
a5f8e277dd
commit
e15746c617
5 changed files with 87 additions and 9 deletions
|
@ -6,6 +6,31 @@ class AdminAreaInvoicesIntegrationTest < ApplicationIntegrationTest
|
|||
sign_in users(:admin)
|
||||
end
|
||||
|
||||
def test_create_new_invoice
|
||||
visit new_admin_invoice_path
|
||||
|
||||
assert_text 'Create new invoice'
|
||||
select 'Best Names', from: 'deposit_registrar_id', match: :first
|
||||
|
||||
fill_in 'Amount', with: '1000'
|
||||
|
||||
click_on 'Save'
|
||||
|
||||
# TODO
|
||||
# Should be assert_text 'Record created'
|
||||
assert_equal page.status_code, 200
|
||||
end
|
||||
|
||||
def test_visit_list_of_invoices_pages
|
||||
visit admin_invoices_path
|
||||
assert_text 'Invoices'
|
||||
end
|
||||
|
||||
def test_visit_invoice_page
|
||||
visit admin_invoices_path(id: @invoice.id)
|
||||
assert_text "Invoice no. #{@invoice.number}"
|
||||
end
|
||||
|
||||
def test_downloads_invoice
|
||||
assert_equal 1, @invoice.number
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue