Permalink
Browse files

Merge pull request #253 from i0rek/url

Various fixes for Typhoeus
  • Loading branch information...
2 parents 179f80e + feafeb8 commit fb76bcdce6d24ce81ab253243ff9a052163256e2 @bblimke committed Feb 17, 2013
@@ -60,7 +60,7 @@ def self.build_request_signature(req)
body = req.options[:body]
request_signature = WebMock::RequestSignature.new(
- req.options[:method],
+ req.options[:method] || :get,
uri.to_s,
:body => body,
:headers => req.options[:headers]
@@ -13,7 +13,7 @@
#functionality only supported for em-http-request 1.x
if defined?(EventMachine::HttpConnection)
- context 'when a real request is made and redirects are followed' do
+ context 'when a real request is made and redirects are followed', :net_connect => true do
before { WebMock.allow_net_connect! }
# This url redirects to the https URL.
@@ -116,7 +116,7 @@ def response(resp)
end
end
- context 'making a real request' do
+ context 'making a real request', :net_connect => true do
before { WebMock.allow_net_connect! }
include_examples "em-http-request middleware/after_request hook integration"
end
@@ -20,7 +20,7 @@
let(:no_content_url) { 'http://httpstat.us/204' }
[nil, ''].each do |stub_val|
- it "returns the same value (nil or "") for a request stubbed as #{stub_val.inspect} that a real empty response has" do
+ it "returns the same value (nil or "") for a request stubbed as #{stub_val.inspect} that a real empty response has", :net_connect => true do
unless http_library == :curb
WebMock.allow_net_connect!
@@ -22,7 +22,7 @@
describe "when params are used" do
it "should take into account params for POST request" do
- stub_request(:post, "www.example.com").with(:params => {:hello => 'world'})
+ stub_request(:post, "www.example.com/?hello=world").with(:params => {:hello => 'world'})
request = Typhoeus::Request.new("http://www.example.com", :method => :post, :params => {:hello => 'world'})
hydra.queue(request)
hydra.run

0 comments on commit fb76bcd

Please sign in to comment.