Add file fixture to download history tests

This commit is contained in:
Thiago Youssef 2022-03-08 17:31:00 +02:00
parent b78f3e846d
commit 71001ce056
4 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,3 @@
Name,ID,Ident,Registrar,Action,Created at
,test_code,[ ],Best Names,update,2018-04-23 15:50:48
,,[ ],,update,2010-07-04 21:00:00
1 Name ID Ident Registrar Action Created at
2 test_code [ ] Best Names update 2018-04-23 15:50:48
3 [ ] update 2010-07-04 21:00:00

View file

@ -0,0 +1,3 @@
Name,Registrant,Registrar,Action,Created at
,test_code,Best Names,update,2018-04-23 15:50:48
,John,,update,2010-07-04 21:00:00
1 Name Registrant Registrar Action Created at
2 test_code Best Names update 2018-04-23 15:50:48
3 John update 2010-07-04 21:00:00

View file

@ -62,11 +62,10 @@ class ContactVersionsTest < ApplicationSystemTestCase
travel_to now travel_to now
get admin_contact_versions_path(format: :csv) get admin_contact_versions_path(format: :csv)
assert_response :ok assert_response :ok
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type'] 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), 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'] response.headers['Content-Disposition']
assert_not_empty response.body assert_equal file_fixture('contact_versions.csv').read, response.body
end end
end end

View file

@ -98,7 +98,7 @@ class DomainVersionsTest < ApplicationSystemTestCase
assert_equal 'text/csv; charset=utf-8', response.headers['Content-Type'] 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), 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'] response.headers['Content-Disposition']
assert_not_empty response.body assert_equal file_fixture('domain_versions.csv').read, response.body
end end
def test_search_event_param def test_search_event_param