mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +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
|
||||
|
||||
included do
|
||||
validates :auth_info, presence: true
|
||||
after_initialize :generate_auth_info, if: :new_record?
|
||||
end
|
||||
|
||||
|
|
|
@ -6,6 +6,12 @@ class ContactTransferTest < ActiveSupport::TestCase
|
|||
@new_registrar = registrars(:goodnames)
|
||||
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
|
||||
contact = Contact.new
|
||||
another_contact = Contact.new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue