mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
parent
f8765eca4d
commit
199085f8ac
15 changed files with 152 additions and 113 deletions
25
test/integration/registrant_area/domains_test.rb
Normal file
25
test/integration/registrant_area/domains_test.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrantAreaDomainsIntegrationTest < ApplicationIntegrationTest
|
||||
setup do
|
||||
sign_in users(:registrant)
|
||||
end
|
||||
|
||||
def test_downloads_list_as_csv
|
||||
get registrant_domains_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal "#{Mime[:csv]}; charset=utf-8", response.headers['Content-Type']
|
||||
assert_equal 'attachment; filename="domains.csv"', response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
|
||||
def test_downloads_list_as_pdf
|
||||
get registrant_domains_path(format: :pdf)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal Mime[:pdf], response.headers['Content-Type']
|
||||
assert_equal 'attachment; filename="domains.pdf"', response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
25
test/integration/registrar_area/contacts_test.rb
Normal file
25
test/integration/registrar_area/contacts_test.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrarAreaContactsIntegrationTest < ApplicationIntegrationTest
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_downloads_list_as_csv
|
||||
get registrar_contacts_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal "#{Mime[:csv]}; charset=utf-8", response.headers['Content-Type']
|
||||
assert_equal 'attachment; filename="contacts.csv"', response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
|
||||
def test_downloads_list_as_pdf
|
||||
get registrar_contacts_path(format: :pdf)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal Mime[:pdf], response.headers['Content-Type']
|
||||
assert_equal 'attachment; filename="contacts.pdf"', response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
20
test/integration/registrar_area/domains_test.rb
Normal file
20
test/integration/registrar_area/domains_test.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrarAreaDomainsIntegrationTest < ApplicationIntegrationTest
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_downloads_list_as_csv
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get registrar_domains_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal "#{Mime[:csv]}; charset=utf-8", response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="Domains_#{l(now, format: :filename)}.csv"),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue