Use resourceful routes

https://github.com/rails/rails/pull/23980
This commit is contained in:
Artur Beljajev 2019-10-12 17:06:35 +03:00
parent f8765eca4d
commit 199085f8ac
15 changed files with 152 additions and 113 deletions

View 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