mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
parent
77d0ba71e1
commit
7997d34aea
4 changed files with 19 additions and 1 deletions
|
@ -14,7 +14,7 @@ module Concerns::Contact::Transferable
|
|||
new_contact.regenerate_code
|
||||
new_contact.regenerate_auth_info
|
||||
new_contact.remove_address unless self.class.address_processing?
|
||||
new_contact.save!
|
||||
new_contact.save(validate: false)
|
||||
new_contact
|
||||
end
|
||||
|
||||
|
|
6
test/fixtures/contacts.yml
vendored
6
test/fixtures/contacts.yml
vendored
|
@ -30,3 +30,9 @@ acme_ltd:
|
|||
ident_country_code: US
|
||||
code: acme-ltd-001
|
||||
auth_info: 720b3c
|
||||
|
||||
invalid:
|
||||
name: any
|
||||
code: any
|
||||
auth_info: any
|
||||
registrar: bestnames
|
||||
|
|
|
@ -8,4 +8,8 @@ class ContactTest < ActiveSupport::TestCase
|
|||
def test_validates
|
||||
assert @contact.valid?
|
||||
end
|
||||
|
||||
def test_invalid_fixture_is_invalid
|
||||
assert contacts(:invalid).invalid?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -48,6 +48,14 @@ class ContactTransferTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_bypasses_validation
|
||||
@contact = contacts(:invalid)
|
||||
|
||||
assert_difference 'Contact.count' do
|
||||
@contact.transfer(@new_registrar)
|
||||
end
|
||||
end
|
||||
|
||||
def test_changes_registrar
|
||||
new_contact = @contact.transfer(@new_registrar)
|
||||
assert_equal @new_registrar, new_contact.registrar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue