我想https
使用webmock
. 让我们假设网关 url 为https://some_gateway.com
.
做完之后:
stub_request(:post, 'https://some_gateway.com').with(body: {})
在规格中。
我使用 Net::HTTP 生成请求:
Net::HTTP.post_form(URI.parse('https://some_gateway.com'), {})
我收到问题是因为 Webmock 期望https://some_gateway.com
但收到添加了端口 433 的版本,所以:http://www.secure.fake-payment.com:443/gateway_prod
所以看不到已注册的存根。
我该如何处理这种行为?