Extract domain transferable module

#660
This commit is contained in:
Artur Beljajev 2018-01-21 18:29:42 +02:00
parent 5716016192
commit 340e61804b
5 changed files with 40 additions and 32 deletions

View file

@ -5,6 +5,26 @@ class DomainTest < ActiveSupport::TestCase
@domain = domains(:shop)
end
def test_validates
assert @domain.valid?
end
def test_generates_random_auth_info_if_new
domain = Domain.new
another_domain = Domain.new
refute_empty domain.auth_info
refute_empty another_domain.auth_info
refute_equal domain.auth_info, another_domain.auth_info
end
def test_does_not_regenerate_auth_info_if_persisted
original_auth_info = @domain.auth_info
@domain.save!
@domain.reload
assert_equal original_auth_info, @domain.auth_info
end
def test_transfers_domain
old_auth_info = @domain.auth_info
new_registrar = registrars(:goodnames)