mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 16:39:55 +02:00
Merge branch 'master' of github.com:domify/registry
This commit is contained in:
commit
8ed8687691
4 changed files with 165 additions and 111 deletions
|
@ -170,12 +170,26 @@ describe 'EPP Contact', epp: true do
|
|||
Contact.last.code.should == 'FIRST0:ABC:ABC:12345'
|
||||
end
|
||||
|
||||
it 'should add registrar prefix for code when missing' do
|
||||
response = create_request({ id: { value: 'abc:ABC:12345' } })
|
||||
response[:msg].should == 'Command completed successfully'
|
||||
response[:result_code].should == '1000'
|
||||
|
||||
Contact.last.code.should == 'FIRST0:ABC:ABC:12345'
|
||||
end
|
||||
|
||||
it 'should not allow spaces in custom code' do
|
||||
response = create_request({ id: { value: 'abc 123' } })
|
||||
response[:msg].should == 'is invalid [code]'
|
||||
response[:result_code].should == '2005'
|
||||
end
|
||||
|
||||
fit 'should not allow spaces in custom code' do
|
||||
response = create_request({ id: { value: '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' } })
|
||||
response[:msg].should == 'is invalid [code]'
|
||||
response[:result_code].should == '2005'
|
||||
end
|
||||
|
||||
it 'should not saves ident type with wrong country code' do
|
||||
extension = {
|
||||
ident: {
|
||||
|
@ -189,6 +203,31 @@ describe 'EPP Contact', epp: true do
|
|||
response[:result_code].should == '2005'
|
||||
end
|
||||
|
||||
it 'should return country missing' do
|
||||
extension = {
|
||||
ident: {
|
||||
value: '1990-22-12',
|
||||
attrs: { type: 'birthday' }
|
||||
}
|
||||
}
|
||||
response = create_request({}, extension, validate_input: false)
|
||||
response[:msg].should ==
|
||||
'Required ident attribute missing: cc'
|
||||
response[:result_code].should == '2003'
|
||||
end
|
||||
|
||||
it 'should return country missing' do
|
||||
extension = {
|
||||
ident: {
|
||||
value: '1990-22-12'
|
||||
}
|
||||
}
|
||||
response = create_request({}, extension, validate_input: false)
|
||||
response[:msg].should ==
|
||||
'Required ident attribute missing: type'
|
||||
response[:result_code].should == '2003'
|
||||
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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue