mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Add test for foreign invoices in registrar #2819
This commit is contained in:
parent
a551d1b4e0
commit
d5563a4d2b
1 changed files with 13 additions and 0 deletions
|
@ -50,5 +50,18 @@ feature 'Invoices', type: :feature do
|
|||
response_headers['Content-Type'].should == 'application/pdf'
|
||||
response_headers['Content-Disposition'].should == "attachment; filename=\"#{@invoice.pdf_name}\""
|
||||
end
|
||||
|
||||
it 'should not see foreign invoices' do
|
||||
user2 = Fabricate(:api_user, identity_code: @user.identity_code)
|
||||
visit '/registrar/invoices'
|
||||
click_link @invoice.to_s
|
||||
page.should have_text(@invoice.to_s)
|
||||
page.should have_text('Buyer')
|
||||
click_link "#{user2} (#{user2.roles.first}) - #{user2.registrar}"
|
||||
page.should have_text('You are not authorized to access this page.')
|
||||
|
||||
visit "/registrar/invoices/#{@invoice.id}/forward"
|
||||
page.should have_text('You are not authorized to access this page.')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue