mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 21:46:24 +02:00
Merge pull request #2396 from internetee/2391-domain-pdf
Admin: download pdf with domain data on show
This commit is contained in:
commit
c488085cb3
7 changed files with 276 additions and 3 deletions
18
test/integration/admin_area/domain_show_test.rb
Normal file
18
test/integration/admin_area/domain_show_test.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require 'test_helper'
|
||||
|
||||
class DomainShowTest < ApplicationIntegrationTest
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
sign_in users(:admin)
|
||||
end
|
||||
|
||||
def test_downloads_domain
|
||||
filename = "#{@domain.name}.pdf"
|
||||
get download_admin_domain_path(@domain)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'application/pdf', response.headers['Content-Type']
|
||||
assert_equal "attachment; filename=\"#{filename}\"; filename*=UTF-8''#{filename}", response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue