mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
parent
435e1d5d64
commit
1fdd3482f0
2 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@ module Concerns::Contact::Transferable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
validates :auth_info, presence: true
|
||||||
after_initialize :generate_auth_info, if: :new_record?
|
after_initialize :generate_auth_info, if: :new_record?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,12 @@ class ContactTransferTest < ActiveSupport::TestCase
|
||||||
@new_registrar = registrars(:goodnames)
|
@new_registrar = registrars(:goodnames)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_rejects_absent_auth_info
|
||||||
|
@contact.auth_info = nil
|
||||||
|
@contact.validate
|
||||||
|
assert @contact.invalid?
|
||||||
|
end
|
||||||
|
|
||||||
def test_generates_unique_auth_info_if_contact_is_new
|
def test_generates_unique_auth_info_if_contact_is_new
|
||||||
contact = Contact.new
|
contact = Contact.new
|
||||||
another_contact = Contact.new
|
another_contact = Contact.new
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue