mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 18:59:38 +02:00
Add session helpers for request specs
This commit is contained in:
parent
e963de58cf
commit
4ae4c28d97
2 changed files with 34 additions and 0 deletions
32
spec/support/requests/session_helpers.rb
Normal file
32
spec/support/requests/session_helpers.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
module Requests
|
||||
module SessionHelpers
|
||||
def sign_in_to_epp_area(user: FactoryGirl.create(:api_user))
|
||||
login_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
|
||||
<epp xmlns=\"urn:ietf:params:xml:ns:epp-1.0\">
|
||||
<command>
|
||||
<login>
|
||||
<clID>#{user.username}</clID>
|
||||
<pw>#{user.password}</pw>
|
||||
<options>
|
||||
<version>1.0</version>
|
||||
<lang>en</lang>
|
||||
</options>
|
||||
<svcs>
|
||||
<objURI>https://epp.tld.ee/schema/domain-eis-1.0.xsd</objURI>
|
||||
<objURI>https://epp.tld.ee/schema/contact-eis-1.0.xsd</objURI>
|
||||
<objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
|
||||
<objURI>urn:ietf:params:xml:ns:keyrelay-1.0</objURI>
|
||||
<svcExtension>
|
||||
<extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>
|
||||
<extURI>https://epp.tld.ee/schema/eis-1.0.xsd</extURI>
|
||||
</svcExtension>
|
||||
</svcs>
|
||||
</login>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>"
|
||||
|
||||
post '/epp/session/login', frame: login_xml
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue