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

@ -62,11 +62,10 @@ class ContactVersionsTest < ApplicationSystemTestCase
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
assert_equal file_fixture('contact_versions.csv').read, response.body
end
end