Add tests, fix error handling

This commit is contained in:
Alex Sherman 2020-06-01 15:11:47 +05:00
parent e15b1283e5
commit e92afb59c1
2 changed files with 26 additions and 8 deletions

View file

@ -0,0 +1,21 @@
require 'application_system_test_case'
class AdminAreaDomainsLegalDocTest < ApplicationSystemTestCase
setup do
sign_in users(:admin)
@domain = domains(:shop)
@document = LegalDocument.create(
document_type: 'pdf',
documentable_id: @domain.id,
documentable_type: 'Domain',
path: '\zzz\zzz'
)
end
def test_absent_doc_downloading_without_errors
visit admin_domain_url(@domain)
assert_nothing_raised do
click_on "#{@document.created_at}"
end
end
end