Fix error if domain name was nil.

Used for some old history entries
Closes #1663
This commit is contained in:
Alex Sherman 2020-08-27 13:04:43 +05:00
parent 76e4e32dc9
commit a0029d0a80
2 changed files with 9 additions and 2 deletions

View file

@ -270,6 +270,13 @@ class DomainTest < ActiveSupport::TestCase
assert_equal 'shop.test', domain.domain_name.to_s
end
def test_nil_name_doesnt_throw_error
domain = Domain.new(name: 'shop.test')
assert_nothing_raised do
domain.name = nil
end
end
def test_returns_registrant_user_domains_by_registrant
registrant = contacts(:john).becomes(Registrant)
assert_equal registrant, @domain.registrant