Sha256: 6180b4669b8e779af91aa972ed2be0f7056f917d1eace80800ce0f86e6beb735

Contents?: true

Size: 931 Bytes

Versions: 14

Compression:

Stored size: 931 Bytes

Contents

require File.join( File.dirname(File.expand_path(__FILE__)), 'base')

require 'webmock/rspec'
include WebMock

describe RestClient::Request do

  it "manage params for get requests" do
    stub_request(:get, 'http://some/resource?a=b&c=d').with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Foo'=>'bar'}).to_return(:body => 'foo', :status => 200)
    RestClient::Request.execute(:url => 'http://some/resource', :method => :get, :headers => {:foo => :bar, :params => {:a => :b, 'c' => 'd'}}).body.should == 'foo'

    stub_request(:get, 'http://some/resource').with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Foo'=>'bar', 'params' => 'a'}).to_return(:body => 'foo', :status => 200)
    RestClient::Request.execute(:url => 'http://some/resource', :method => :get, :headers => {:foo => :bar, :params => :a}).body.should == 'foo'
  end

end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
larsburgess-rest-client-1.6.1 spec/request2_spec.rb
gemrage-1.0.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.4.1 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.4.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.3.2 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.3.1 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.3.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.2.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.1.2 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.1.1 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.1.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
gemrage-0.0.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/request2_spec.rb
rest-client-1.6.1 spec/request2_spec.rb
rest-client-1.6.1.a spec/request2_spec.rb