Add tests

This commit is contained in:
Thiago Youssef 2022-06-29 10:44:17 -03:00
parent b909578c2c
commit b33f3a93d9

View file

@ -0,0 +1,18 @@
require 'test_helper'
class DomainTest < ApplicationIntegrationTest
setup do
@domain = domains(:shop)
sign_in users(:admin)
end
def test_downloads_domain
filename = "#{@domain.name}.pdf"
get download_admin_domain_path(@domain)
assert_response :ok
assert_equal 'application/pdf', response.headers['Content-Type']
assert_equal "attachment; filename=\"#{filename}\"; filename*=UTF-8''#{filename}", response.headers['Content-Disposition']
assert_not_empty response.body
end
end