mirror of
https://github.com/internetee/registry.git
synced 2025-07-26 04:28:27 +02:00
parent
0a04f19e69
commit
29141110cc
1 changed files with 12 additions and 5 deletions
|
@ -6,18 +6,20 @@ class ContactTransferTest < ActiveSupport::TestCase
|
||||||
@new_registrar = registrars(:goodnames)
|
@new_registrar = registrars(:goodnames)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_rejects_absent_auth_info
|
def test_invalid_without_auth_info
|
||||||
@contact.auth_info = nil
|
@contact.auth_info = nil
|
||||||
@contact.validate
|
@contact.validate
|
||||||
assert @contact.invalid?
|
assert @contact.invalid?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_generates_unique_auth_info_if_contact_is_new
|
def test_generates_default_auth_info
|
||||||
|
contact = Contact.new
|
||||||
|
refute_empty contact.auth_info
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_generated_auth_info_is_random
|
||||||
contact = Contact.new
|
contact = Contact.new
|
||||||
another_contact = Contact.new
|
another_contact = Contact.new
|
||||||
|
|
||||||
refute_empty contact.auth_info
|
|
||||||
refute_empty another_contact.auth_info
|
|
||||||
refute_equal contact.auth_info, another_contact.auth_info
|
refute_equal contact.auth_info, another_contact.auth_info
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,6 +30,11 @@ class ContactTransferTest < ActiveSupport::TestCase
|
||||||
assert_equal original_auth_info, @contact.auth_info
|
assert_equal original_auth_info, @contact.auth_info
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_overrides_default_auth_info
|
||||||
|
contact = Contact.new(auth_info: '1bad4f')
|
||||||
|
assert_equal '1bad4f', contact.auth_info
|
||||||
|
end
|
||||||
|
|
||||||
def test_keeps_original_contact_untouched
|
def test_keeps_original_contact_untouched
|
||||||
original_hash = @contact.to_json
|
original_hash = @contact.to_json
|
||||||
new_contact = @contact.transfer(@new_registrar)
|
new_contact = @contact.transfer(@new_registrar)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue