mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +02:00
added csv download
This commit is contained in:
parent
c7e92452af
commit
7f8eee52f4
41 changed files with 259 additions and 35 deletions
|
@ -3,7 +3,7 @@ require 'application_system_test_case'
|
|||
|
||||
|
||||
# /admin/blocked_domains
|
||||
class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCase
|
||||
class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCase
|
||||
setup do
|
||||
WebMock.allow_net_connect!
|
||||
sign_in users(:admin)
|
||||
|
@ -48,6 +48,19 @@ class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCa
|
|||
assert_text @domain.name
|
||||
end
|
||||
|
||||
def test_download_blocked_domains
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get admin_blocked_domains_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="blocked_domains_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''blocked_domains_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def visit_admin_blocked_domains_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue