require 'test_helper' class RegistrarXmlConsolesIntegrationTest < ApplicationIntegrationTest setup do sign_in users(:api_bestnames) end def test_check_schema_path post registrar_xml_console_path, params: { frame: payload }, headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } assert_response :ok end def test_load_schema_path get load_xml_registrar_xml_console_path, params: { obj: 'domain', epp_action: 'update' } assert_response :ok assert_equal update_payload, response.body end private def payload <<~XML auction.test XML end def wrong_payload <<~XML auction.test XML end def update_payload <<~XML example.ee ns1.example.com ns2.example.com mak21 ns1.example.net mak21 mak21 newpw 257 3 8 700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f dGVzdCBmYWlsCg== test_bestnames-#{Time.zone.now.to_i} XML end end