mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
Introduce custom assertion
This commit is contained in:
parent
5939da366e
commit
348e6e5d7a
54 changed files with 378 additions and 389 deletions
|
@ -52,7 +52,7 @@ RSpec.describe 'EPP contact:create' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(epp_response).to have_result(:success)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -86,8 +86,7 @@ RSpec.describe 'EPP contact:create' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(epp_response).to have_result(:required_param_missing,
|
||||
'Required parameter missing: extension > extdata > ident [ident]')
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:required_parameter_missing))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -130,9 +129,7 @@ RSpec.describe 'EPP contact:create' do
|
|||
|
||||
specify do
|
||||
request
|
||||
|
||||
message = 'Ident code does not conform to national identification number format of Germany'
|
||||
expect(epp_response).to have_result(:param_syntax_error, message)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:parameter_value_syntax_error))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -174,8 +171,7 @@ RSpec.describe 'EPP contact:create' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(epp_response).to have_result(:param_syntax_error,
|
||||
'Ident code does not conform to registration number format of Germany')
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:parameter_value_syntax_error))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -209,8 +205,7 @@ RSpec.describe 'EPP contact:create' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(epp_response).to have_result(:required_param_missing,
|
||||
'Required ident attribute missing: cc')
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:required_parameter_missing))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -244,7 +239,7 @@ RSpec.describe 'EPP contact:create' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(epp_response).to have_result(:syntax_error)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:syntax_error))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -285,8 +280,7 @@ RSpec.describe 'EPP contact:create' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(epp_response).to have_result(:param_syntax_error,
|
||||
'Ident type "priv" is invalid for Germany')
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:parameter_value_syntax_error))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ RSpec.shared_examples 'EPP contact phone' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -13,7 +13,7 @@ RSpec.shared_examples 'EPP contact phone' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2005)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:parameter_value_syntax_error))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -22,7 +22,7 @@ RSpec.shared_examples 'EPP contact phone' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2005)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:parameter_value_syntax_error))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ RSpec.describe 'EPP contact:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(epp_response).to have_result(:success)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -78,9 +78,7 @@ RSpec.describe 'EPP contact:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
|
||||
expect(epp_response).to have_result(:data_management_policy_violation,
|
||||
t('epp.contacts.errors.valid_ident'))
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:data_management_policy_violation))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -138,7 +136,7 @@ RSpec.describe 'EPP contact:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(epp_response).to have_result(:success)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -190,9 +188,7 @@ RSpec.describe 'EPP contact:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
|
||||
expect(epp_response).to have_result(:data_management_policy_violation,
|
||||
t('epp.contacts.errors.ident_update'))
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:data_management_policy_violation))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -49,7 +49,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -62,7 +62,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2104)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:billing_failure))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -64,7 +64,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2308)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:data_management_policy_violation))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -103,7 +103,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -57,7 +57,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -103,7 +103,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -61,7 +61,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2104)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:billing_failure))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -61,7 +61,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -93,7 +93,7 @@ RSpec.describe 'EPP domain:create', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2003)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:required_parameter_missing))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,7 +51,7 @@ RSpec.describe 'EPP domain:renew' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -86,7 +86,7 @@ RSpec.describe 'EPP domain:renew' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2104)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:billing_failure))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ RSpec.describe 'EPP domain:renew', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,7 +51,7 @@ RSpec.describe 'EPP domain:renew' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -83,7 +83,7 @@ RSpec.describe 'EPP domain:renew' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2306)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:parameter_value_policy_error))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,7 +51,7 @@ RSpec.describe 'EPP domain:renew', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -88,7 +88,7 @@ RSpec.describe 'EPP domain:renew', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,7 +51,7 @@ RSpec.describe 'EPP domain:renew', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -62,7 +62,7 @@ RSpec.describe 'EPP domain:renew', settings: false do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(2104)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:billing_failure))).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -42,7 +42,7 @@ RSpec.describe 'EPP domain:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
|
||||
it 'keeps same registrant' do
|
||||
|
@ -87,7 +87,7 @@ RSpec.describe 'EPP domain:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1001)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully_action_pending))).to be_truthy
|
||||
end
|
||||
|
||||
it 'does not change registrant without confirmation' do
|
||||
|
@ -143,7 +143,7 @@ RSpec.describe 'EPP domain:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
|
||||
it 'keeps same registrant' do
|
||||
|
@ -188,7 +188,7 @@ RSpec.describe 'EPP domain:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
|
||||
it 'changes registrant without confirmation' do
|
||||
|
|
|
@ -43,7 +43,7 @@ RSpec.describe 'EPP domain:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
|
||||
it 'changes registrant' do
|
||||
|
@ -86,7 +86,7 @@ RSpec.describe 'EPP domain:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1001)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully_action_pending))).to be_truthy
|
||||
end
|
||||
|
||||
it 'does not change registrant' do
|
||||
|
@ -135,7 +135,7 @@ RSpec.describe 'EPP domain:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
|
||||
it 'changes registrant' do
|
||||
|
@ -178,7 +178,7 @@ RSpec.describe 'EPP domain:update' do
|
|||
|
||||
specify do
|
||||
request
|
||||
expect(response).to have_code_of(1000)
|
||||
expect(Epp::Response.xml(response.body).code?(Epp::Response::Result::Code.key(:completed_successfully))).to be_truthy
|
||||
end
|
||||
|
||||
it 'changes registrant' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue