Sha256: e0cd7d65451739bc06594fdddaec7b5bb116090ebefcd8284d5e912b217e7efb

Contents?: true

Size: 903 Bytes

Versions: 2

Compression:

Stored size: 903 Bytes

Contents

require File.dirname(__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

2 entries across 2 versions & 1 rubygems

Version Path
rest-client-1.6.0 spec/request2_spec.rb
rest-client-1.6.0.a spec/request2_spec.rb