Sha256: f09791975355f40c3c301e3318763cc1b48c8f180acc77212b5e81d9c389b848
Contents?: true
Size: 1.09 KB
Versions: 6
Compression:
Stored size: 1.09 KB
Contents
require 'helper' class TestRequest < Test::Unit::TestCase def test_initializes_receiving_data_and_optional_id request = MyMoip::Request.new("request_id") assert_equal "request_id", request.id end def test_logs_api_call_method logger = stub_everything request = MyMoip::Request.new("request_id") params = { http_method: :post, body: "<pretty><xml></xml></pretty>", path: "/ws/alpha/EnviarInstrucao/Unica" } HTTParty.stubs(:send).returns("<html>some_result</html>") logger.expects(:info).at_least_once. with(regexp_matches(/request_id.+<html>some_result<\/html>/)) request.api_call(params, logger) end def test_logs_api_call_response logger = stub_everything request = MyMoip::Request.new("request_id") params = { http_method: :post, body: "<pretty><xml></xml></pretty>", path: "/ws/alpha/EnviarInstrucao/Unica" } HTTParty.stubs(:send).returns("<html>some_result</html>") logger.expects(:info).at_least_once. with(regexp_matches(/request_id.+<html>some_result<\/html>/)) request.api_call(params, logger) end end
Version data entries
6 entries across 6 versions & 1 rubygems