contact info should always return something

This commit is contained in:
Priit Tark 2015-03-10 17:36:44 +02:00
parent 876cd6e222
commit e11607cdc4
3 changed files with 33 additions and 16 deletions

View file

@ -444,15 +444,25 @@ describe 'EPP Contact', epp: true do
response[:msg].should == 'Command completed successfully'
response[:result_code].should == '1000'
response[:results].count.should == 1
contact = response[:parsed].css('resData infData')
contact.css('postalInfo addr city').first.try(:text).present?.should == true
contact.css('email').first.try(:text).present?.should == true
contact.css('voice').first.try(:text).should == '+372.12345678'
end
end
it 'returns authorization error for wrong user and wrong pw' do
it 'returns no authorization error for wrong user and wrong pw' do
login_as :registrar2 do
response = info_request({ authInfo: { pw: { value: 'wrong-pw' } } })
response[:msg].should == 'Authorization error'
response[:result_code].should == '2201'
response[:msg].should == 'Command completed successfully'
response[:result_code].should == '1000'
response[:results].count.should == 1
contact = response[:parsed].css('resData infData')
contact.css('postalInfo addr city').first.try(:text).should == nil
contact.css('email').first.try(:text).should == nil
contact.css('voice').first.try(:text).should == nil
end
end
end