Take a look at the answer for this question: WebMock: Rspec - Test Facebook Validation by using JSON response
Your code will do http
request with port 443 vs doing really https
Net::HTTP.post_form(URI.parse('https://some_gateway.com'), {})
And here you can find the answer how to do https
request using Net::HTTP
Using Net::HTTP.get for an https url