mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Validate contact and invoice emails when they change #2745
This commit is contained in:
parent
c482a3e46d
commit
6ca53f946a
7 changed files with 43 additions and 2 deletions
|
@ -133,6 +133,13 @@ describe 'EPP Contact', epp: true do
|
|||
cr_date.text.in_time_zone.utc.should be_within(5).of(Time.zone.now)
|
||||
end
|
||||
|
||||
it 'should return email issue' do
|
||||
response = create_request(email: { value: 'not@valid' })
|
||||
|
||||
response[:msg].should == 'Email is invalid [email]'
|
||||
response[:result_code].should == '2005'
|
||||
end
|
||||
|
||||
it 'should add registrar prefix for code when missing' do
|
||||
response = create_request({ id: { value: 'abc12345' } })
|
||||
response[:msg].should == 'Command completed successfully'
|
||||
|
@ -397,6 +404,18 @@ describe 'EPP Contact', epp: true do
|
|||
response[:results][1][:result_code].should == '2005'
|
||||
end
|
||||
|
||||
it 'should return email issue' do
|
||||
response = update_request({
|
||||
id: { value: 'FIRST0:SH8013' },
|
||||
chg: {
|
||||
email: { value: 'legacy@wrong' }
|
||||
}
|
||||
})
|
||||
|
||||
response[:msg].should == 'Email is invalid [email]'
|
||||
response[:result_code].should == '2005'
|
||||
end
|
||||
|
||||
it 'should not update code with custom string' do
|
||||
response = update_request(
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue