Fix EPP login in specs

#700
This commit is contained in:
Artur Beljajev 2018-02-07 08:46:55 +02:00
parent ad1f5e6144
commit 278ae07ac6
28 changed files with 141 additions and 84 deletions

View file

@ -1,10 +1,11 @@
require 'rails_helper'
RSpec.describe 'EPP contact:delete' do
let(:session_id) { create(:epp_session, user: user, registrar: registrar).session_id }
let(:user) { create(:api_user, registrar: registrar) }
let(:registrar) { create(:registrar) }
let!(:registrant) { create(:registrant, registrar: registrar, code: 'TEST') }
let(:request) { post '/epp/command/delete', frame: request_xml }
let(:request) { post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{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">
@ -20,7 +21,7 @@ RSpec.describe 'EPP contact:delete' do
}
before do
sign_in_to_epp_area(user: user)
login_as user
end
context 'when contact is used' do