mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Merge branch 'master' of github.com:domify/registry
This commit is contained in:
commit
7facd58f31
98 changed files with 1811 additions and 36 deletions
|
@ -104,7 +104,7 @@ describe 'EPP Contact', epp: true do
|
|||
log.api_user_registrar.should == 'registrar1'
|
||||
end
|
||||
|
||||
it 'successfully saves ident type' do
|
||||
it 'successfully saves ident type with legal document' do
|
||||
extension = {
|
||||
legalDocument: {
|
||||
value: 'dGVzdCBmYWlsCg==',
|
||||
|
@ -120,7 +120,9 @@ describe 'EPP Contact', epp: true do
|
|||
response[:msg].should == 'Command completed successfully'
|
||||
response[:result_code].should == '1000'
|
||||
|
||||
Contact.last.ident_type.should == 'birthday'
|
||||
@contact = Contact.last
|
||||
@contact.ident_type.should == 'birthday'
|
||||
@contact.legal_documents.size.should == 1
|
||||
end
|
||||
|
||||
it 'successfully adds registrar' do
|
||||
|
@ -168,6 +170,19 @@ describe 'EPP Contact', epp: true do
|
|||
response[:result_code].should == '2005'
|
||||
end
|
||||
|
||||
it 'should not saves ident type with wrong country code' do
|
||||
extension = {
|
||||
ident: {
|
||||
value: '1990-22-12',
|
||||
attrs: { type: 'birthday', cc: 'WRONG' }
|
||||
}
|
||||
}
|
||||
response = create_request({}, extension)
|
||||
response[:msg].should ==
|
||||
'Ident country code is not valid, should be in ISO_3166-1 alpha 2 format [ident]'
|
||||
response[:result_code].should == '2005'
|
||||
end
|
||||
|
||||
it 'should add registrar prefix for code when legacy prefix present' do
|
||||
response = create_request({ id: { value: 'CID:FIRST0:abc:ABC:NEW:12345' } })
|
||||
response[:msg].should == 'Command completed successfully'
|
||||
|
|
|
@ -1407,11 +1407,88 @@ describe 'EPP Domain', epp: true do
|
|||
|
||||
d = Domain.last
|
||||
|
||||
d.registrant_code.should_not == 'FIXED:CITIZEN_1234' # should not update, because pending
|
||||
d.registrant_code.should_not == 'FIXED:CITIZEN_1234' # should not update
|
||||
d.auth_info.should == existing_pw
|
||||
d.pending_update?.should == true
|
||||
end
|
||||
|
||||
it 'should not return action pending when changes are invalid' do
|
||||
existing_pw = domain.auth_info
|
||||
|
||||
xml_params = {
|
||||
name: { value: domain.name },
|
||||
chg: [
|
||||
registrant: { value: 'FIXED:CITIZEN_1234' }
|
||||
],
|
||||
rem:
|
||||
domain.nameservers.map do |ns|
|
||||
{
|
||||
ns: [
|
||||
{
|
||||
hostAttr: [
|
||||
{ hostName: { value: ns.hostname } }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
response = epp_plain_request(domain_update_xml(xml_params, {}, {
|
||||
_anonymus: [
|
||||
legalDocument: {
|
||||
value: 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==',
|
||||
attrs: { type: 'pdf' }
|
||||
}
|
||||
]
|
||||
}), :xml)
|
||||
|
||||
response[:results][0][:msg].should == 'Nameservers count must be between 2-11 [nameservers]'
|
||||
response[:results][0][:result_code].should == '2004'
|
||||
|
||||
d = Domain.last
|
||||
|
||||
d.registrant_code.should_not == 'FIXED:CITIZEN_1234' # should not update
|
||||
d.auth_info.should == existing_pw
|
||||
d.nameservers.size == 3
|
||||
d.pending_update?.should == false
|
||||
end
|
||||
|
||||
it 'should not return action pending when domain itself is already invaid' do
|
||||
domain_id = domain.id
|
||||
domain.nameservers.delete_all
|
||||
domain.save(validate: false)
|
||||
domain.reload.nameservers.size.should == 0
|
||||
|
||||
existing_pw = domain.auth_info
|
||||
|
||||
xml_params = {
|
||||
name: { value: domain.name },
|
||||
chg: [
|
||||
registrant: { value: 'FIXED:CITIZEN_1234' }
|
||||
]
|
||||
}
|
||||
|
||||
response = epp_plain_request(domain_update_xml(xml_params, {}, {
|
||||
_anonymus: [
|
||||
legalDocument: {
|
||||
value: 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==',
|
||||
attrs: { type: 'pdf' }
|
||||
}
|
||||
]
|
||||
}), :xml)
|
||||
|
||||
response[:results][0][:msg].should == 'Nameservers count must be between 2-11 [nameservers]'
|
||||
response[:results][0][:result_code].should == '2004'
|
||||
|
||||
d = Domain.find(domain_id)
|
||||
|
||||
d.registrant_code.should_not == 'FIXED:CITIZEN_1234' # should not update
|
||||
d.auth_info.should == existing_pw
|
||||
d.nameservers.size.should == 0
|
||||
d.pending_update?.should == false
|
||||
end
|
||||
|
||||
it 'should not allow any update when status pending update' do
|
||||
domain.domain_statuses.create(value: DomainStatus::PENDING_UPDATE)
|
||||
|
||||
|
|
|
@ -73,11 +73,13 @@ describe Contact do
|
|||
end
|
||||
|
||||
it 'should require valid country code' do
|
||||
@contact.ident = '123'
|
||||
@contact.ident_type = 'bic'
|
||||
@contact.ident_country_code = 'INVALID'
|
||||
@contact.valid?
|
||||
|
||||
@contact.errors[:ident_country_code].should == ['is not following ISO_3166-1 alpha 2 format']
|
||||
@contact.errors[:ident].should ==
|
||||
['Ident country code is not valid, should be in ISO_3166-1 alpha 2 format']
|
||||
end
|
||||
|
||||
it 'should convert to alpha2 country code' do
|
||||
|
|
|
@ -106,6 +106,27 @@ describe Domain do
|
|||
end
|
||||
end
|
||||
|
||||
context 'about registrant update confirm when domain is invalid' do
|
||||
before :all do
|
||||
@domain.registrant_verification_token = 123
|
||||
@domain.registrant_verification_asked_at = Time.zone.now
|
||||
@domain.domain_statuses.create(value: DomainStatus::PENDING_UPDATE)
|
||||
end
|
||||
|
||||
it 'should be registrant update confirm ready' do
|
||||
@domain.registrant_update_confirmable?('123').should == true
|
||||
end
|
||||
|
||||
it 'should not be registrant update confirm ready when token does not match' do
|
||||
@domain.registrant_update_confirmable?('wrong-token').should == false
|
||||
end
|
||||
|
||||
it 'should not be registrant update confirm ready when no correct status' do
|
||||
@domain.domain_statuses.delete_all
|
||||
@domain.registrant_update_confirmable?('123').should == false
|
||||
end
|
||||
end
|
||||
|
||||
context 'with versioning' do
|
||||
it 'should not have one version' do
|
||||
with_versioning do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue