internetee-registry/spec/requests/epp/contact/shared/phone.rb
2017-03-06 07:27:11 +02:00

28 lines
524 B
Ruby

RSpec.shared_examples 'EPP contact phone' do
context 'when phone is valid' do
let(:phone) { '+123.4' }
specify do
request
expect(response).to have_code_of(1000)
end
end
context 'when phone has invalid format' do
let(:phone) { '1234' }
specify do
request
expect(response).to have_code_of(2005)
end
end
context 'when phone has only zeros' do
let(:phone) { '+000.0' }
specify do
request
expect(response).to have_code_of(2005)
end
end
end