require 'rails_helper' RSpec.describe 'EPP domain:delete' do let(:request_xml) { <<-XML test.com dGVzdCBmYWlsCg== XML } before :example do sign_in_to_epp_area 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 expect(response).to have_code_of(1001) end end context 'when domain is discarded' do let!(:domain) { create(:domain_discarded, name: 'test.com') } it 'returns epp code of 2105' do post '/epp/command/delete', frame: request_xml expect(response).to have_code_of(2105) end end end