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
|
||||
|
|
|
@ -70,4 +70,17 @@ class AdminDisputesSystemTest < ApplicationSystemTestCase
|
|||
|
||||
assert_text 'Dispute already exists for this domain at given timeframe'
|
||||
end
|
||||
|
||||
def test_download_disputes
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get admin_disputes_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="disputes_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''disputes_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,6 +36,19 @@ class AdminEppLogsIntegrationTest < ApplicationSystemTestCase
|
|||
assert_match /#{date_now}/, epp_log_date
|
||||
end
|
||||
|
||||
def test_download_epp_logs
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get admin_epp_logs_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="epp_logs_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''epp_logs_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def send_epp_request_hello
|
||||
|
|
|
@ -15,9 +15,22 @@ class AdminAreaReppLogsIntegrationTest < ApplicationSystemTestCase
|
|||
visit admin_repp_logs_path
|
||||
get repp_v1_contacts_path
|
||||
visit admin_repp_logs_path
|
||||
|
||||
|
||||
find(:xpath, "//tbody/tr/td/a", match: :first).click
|
||||
|
||||
assert_text 'REPP log'
|
||||
end
|
||||
|
||||
def test_download_repp_logs
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get admin_repp_logs_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="repp_logs_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''repp_logs_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ class AdminAreaReservedDomainsIntegrationTest < JavaScriptApplicationSystemTestC
|
|||
end
|
||||
|
||||
def test_remove_reserved_domain
|
||||
visit admin_reserved_domains_path
|
||||
visit admin_reserved_domains_path
|
||||
click_link_or_button 'Delete', match: :first
|
||||
page.driver.browser.switch_to.alert.accept
|
||||
|
||||
|
@ -36,4 +36,17 @@ class AdminAreaReservedDomainsIntegrationTest < JavaScriptApplicationSystemTestC
|
|||
|
||||
assert_text 'Domain updated!'
|
||||
end
|
||||
|
||||
def test_download_reserved_domains
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get admin_reserved_domains_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="reserved_domains_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''reserved_domains_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@ class ContactVersionsTest < ApplicationSystemTestCase
|
|||
VALUES ('Contact', 75, 'update', '1-AdminUser',
|
||||
'{"id": 75, "code": "test_code", "auth_info": "8b4d462aa04194ca78840a", "registrar_id": #{@registrar.id}, "old_field": "value",
|
||||
"legal_id": "123"}',
|
||||
'{"other_made_up_field": "value"}',
|
||||
'{"other_made_up_field": "value"}',
|
||||
'2018-04-23 15:50:48.113491', '2018-04-23 12:44:56',
|
||||
'{"legal_documents":[null]}', null, null
|
||||
)
|
||||
|
@ -56,4 +56,17 @@ class ContactVersionsTest < ApplicationSystemTestCase
|
|||
assert_text 'Best Names'
|
||||
assert_text '23.04.18, 18:50 update 1-AdminUser'
|
||||
end
|
||||
|
||||
def test_download_contact_history
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get admin_contact_versions_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="contact_history_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''contact_history_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
||||
|
|
|
@ -39,4 +39,17 @@ class AdminContactsTest < ApplicationSystemTestCase
|
|||
assert_text('Street Main Street City New York Postcode 12345 ' \
|
||||
'State New York State Country United States of America')
|
||||
end
|
||||
|
||||
def test_download_contacts
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get admin_contacts_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="contacts_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''contacts_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
end
|
||||
|
|
|
@ -88,6 +88,19 @@ class DomainVersionsTest < ApplicationSystemTestCase
|
|||
'http://www.example.com/admin/domain_versions?q[name]=shop.test&q[registrant]=&q[registrar]=&q[event]=&results_per_page='
|
||||
end
|
||||
|
||||
def test_download_domain_history
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
|
||||
get admin_domain_versions_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="domain_history_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''domain_history_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
|
||||
def test_search_event_param
|
||||
# TODO
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue