mirror of
https://github.com/internetee/registry.git
synced 2025-08-26 19:13:40 +02:00
Address depricated, new contact requires, domain_contacts refactor
This commit is contained in:
parent
0e252b0b6b
commit
5fd73b037a
38 changed files with 402 additions and 501 deletions
|
@ -2,12 +2,9 @@ require 'rails_helper'
|
|||
|
||||
describe Contact do
|
||||
before :all do
|
||||
create_disclosure_settings
|
||||
@api_user = Fabricate(:api_user)
|
||||
end
|
||||
|
||||
it { should have_one(:address) }
|
||||
|
||||
context 'about class' do
|
||||
it 'should have versioning enabled?' do
|
||||
Contact.paper_trail_enabled_for_model?.should == true
|
||||
|
@ -32,9 +29,12 @@ describe Contact do
|
|||
"Email Required parameter missing - email",
|
||||
"Email Email is invalid",
|
||||
"Ident Required parameter missing - ident",
|
||||
"Address is missing",
|
||||
"Registrar is missing",
|
||||
"Ident type is missing"
|
||||
"Ident type is missing",
|
||||
"City is missing",
|
||||
"Country code is missing",
|
||||
"Street is missing",
|
||||
"Zip is missing"
|
||||
])
|
||||
end
|
||||
|
||||
|
@ -101,7 +101,7 @@ describe Contact do
|
|||
|
||||
context 'with valid attributes' do
|
||||
before :all do
|
||||
@contact = Fabricate(:contact, disclosure: nil)
|
||||
@contact = Fabricate(:contact)
|
||||
end
|
||||
|
||||
it 'should be valid' do
|
||||
|
@ -169,11 +169,20 @@ describe Contact do
|
|||
|
||||
contact.statuses.map(&:value).should == %w(ok linked)
|
||||
|
||||
contact.domains.destroy_all
|
||||
contact.save
|
||||
contact.domains.first.destroy
|
||||
contact.reload
|
||||
contact.statuses.map(&:value).should == %w(ok)
|
||||
end
|
||||
|
||||
it 'should have linked status when domain is created' do
|
||||
# @admin_domain_contact = Fabricate(:admin_domain_contact)
|
||||
# @domain = Fabricate(:domain, admin_domain_contacts: [@admin_domain_contact])
|
||||
# puts @domain.contacts.size
|
||||
# contact = @domain.contacts.first
|
||||
|
||||
# contact.statuses.map(&:value).should == %w(ok linked)
|
||||
end
|
||||
|
||||
context 'as birthday' do
|
||||
before :all do
|
||||
@contact.ident_type = 'birthday'
|
||||
|
@ -199,25 +208,6 @@ describe Contact do
|
|||
end
|
||||
end
|
||||
|
||||
it 'should have empty disclosure' do
|
||||
@contact.disclosure.name.should == nil
|
||||
@contact.disclosure.org_name.should == nil
|
||||
@contact.disclosure.email.should == nil
|
||||
@contact.disclosure.phone.should == nil
|
||||
@contact.disclosure.fax.should == nil
|
||||
@contact.disclosure.address.should == nil
|
||||
end
|
||||
|
||||
it 'should have custom disclosure' do
|
||||
@contact = Fabricate(:contact, disclosure: Fabricate(:contact_disclosure))
|
||||
@contact.disclosure.name.should == true
|
||||
@contact.disclosure.org_name.should == true
|
||||
@contact.disclosure.email.should == true
|
||||
@contact.disclosure.phone.should == true
|
||||
@contact.disclosure.fax.should == true
|
||||
@contact.disclosure.address.should == true
|
||||
end
|
||||
|
||||
context 'with callbacks' do
|
||||
before :all do
|
||||
# Ensure callbacks are not taken out from other specs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue