mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
parent
ad1f5e6144
commit
278ae07ac6
28 changed files with 141 additions and 84 deletions
|
@ -1,6 +1,9 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'EPP domain:delete' do
|
||||
let(:registrar) { create(:registrar) }
|
||||
let(:user) { create(:api_user_epp, registrar: registrar) }
|
||||
let(:session_id) { create(:epp_session, user: user, registrar: registrar).session_id }
|
||||
let(:request_xml) { <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
|
@ -21,14 +24,14 @@ RSpec.describe 'EPP domain:delete' do
|
|||
}
|
||||
|
||||
before :example do
|
||||
sign_in_to_epp_area
|
||||
login_as user
|
||||
end
|
||||
|
||||
context 'when domain is not discarded' do
|
||||
let!(:domain) { create(:domain, name: 'test.com') }
|
||||
|
||||
it 'returns epp code of 1001' do
|
||||
post '/epp/command/delete', frame: request_xml
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session_id}"
|
||||
expect(response).to have_code_of(1001)
|
||||
end
|
||||
end
|
||||
|
@ -37,7 +40,7 @@ RSpec.describe 'EPP domain:delete' do
|
|||
let!(:domain) { create(:domain_discarded, name: 'test.com') }
|
||||
|
||||
it 'returns epp code of 2105' do
|
||||
post '/epp/command/delete', frame: request_xml
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session_id}"
|
||||
expect(response).to have_code_of(2105)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue