Hi
I need to stub the HTTP Party request tto run my specs.
I am getting the response as sucess bu i need my response such that i have to store the transaction id from the parsed response by using
response.parsed_response['Success']['TransactionId']
If i try as below i get my response as
#<HTTParty::Response:0x5d51240 parsed_response="{'Success': { 'TransactionId' => '123456789' }}", @response=#<Net::HTTPOK 200 readbody=true>, @headers={}>
Can any one help me to modify my stub so that i can store the transaction id
P.S if i check the response as response.success? it returns true
response.parsed_response it returns as "{'Success': { 'TransactionId' => '123456789' }}"
response.parsed_response['Success'] returns "Success"
stub_request(:post, {URL}).to_return(status: 200, body:
"{'Success': { 'TransactionId' => '123456789' }}", headers: {})