mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Refactor email sending, tests
This commit is contained in:
parent
d3c17ce4e3
commit
12e32af524
3 changed files with 24 additions and 7 deletions
|
@ -4,7 +4,7 @@ feature 'Invoices', type: :feature do
|
|||
before :all do
|
||||
create_settings
|
||||
@user = Fabricate(:api_user)
|
||||
Fabricate(:invoice)
|
||||
@invoice = Fabricate(:invoice, buyer: @user.registrar)
|
||||
end
|
||||
|
||||
context 'as unknown user' do
|
||||
|
@ -32,5 +32,24 @@ feature 'Invoices', type: :feature do
|
|||
visit '/registrar/invoices'
|
||||
page.should have_text('Invoices')
|
||||
end
|
||||
|
||||
it 'should forward invoice' do
|
||||
visit '/registrar/invoices'
|
||||
click_link @invoice.to_s
|
||||
click_link 'Forward invoice'
|
||||
click_button 'Forward'
|
||||
page.should have_text('Failed to forward invoice')
|
||||
fill_in 'Billing email', with: 'test@test.ee'
|
||||
click_button 'Forward'
|
||||
page.should have_text('Invoice forwarded')
|
||||
end
|
||||
|
||||
it 'should download invoice' do
|
||||
visit '/registrar/invoices'
|
||||
click_link @invoice.to_s
|
||||
click_link 'Download'
|
||||
response_headers['Content-Type'].should == 'application/pdf'
|
||||
response_headers['Content-Disposition'].should == "attachment; filename=\"#{@invoice.pdf_name}\""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue