mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
Update to webmock 2.0
This commit is contained in:
parent
30ef4d39ca
commit
d9f6677304
2 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|||
s.homepage = 'https://github.com/rest-client/rest-client'
|
||||
s.summary = 'Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.'
|
||||
|
||||
s.add_development_dependency('webmock', '~> 1.4')
|
||||
s.add_development_dependency('webmock', '~> 2.0')
|
||||
s.add_development_dependency('rspec', '~> 2.99')
|
||||
s.add_development_dependency('pry', '~> 0')
|
||||
s.add_development_dependency('pry-doc', '~> 0')
|
||||
|
|
|
@ -109,8 +109,8 @@ describe RestClient::Response, :include_helpers do
|
|||
end
|
||||
|
||||
it "follows a redirection and keep the parameters" do
|
||||
stub_request(:get, 'http://foo:bar@some/resource').with(:headers => {'Accept' => 'application/json'}).to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'})
|
||||
stub_request(:get, 'http://foo:bar@new/resource').with(:headers => {'Accept' => 'application/json'}).to_return(:body => 'Foo')
|
||||
stub_request(:get, 'http://some/resource').with(:headers => {'Accept' => 'application/json'}, :basic_auth => ['foo', 'bar']).to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'})
|
||||
stub_request(:get, 'http://new/resource').with(:headers => {'Accept' => 'application/json'}, :basic_auth => ['foo', 'bar']).to_return(:body => 'Foo')
|
||||
RestClient::Request.execute(:url => 'http://some/resource', :method => :get, :user => 'foo', :password => 'bar', :headers => {:accept => :json}).body.should eq 'Foo'
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue