Skip to content

Commit

Permalink
spec for converting keys to symbols when Mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbegin committed Sep 8, 2015
1 parent 6e334ae commit fa4583c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/acceptance/shared/stubbing_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@
end

describe "based on query params" do
it "should turn query values into strings before compairing" do
it "converts hash keys into strings" do
stub_request(:get, "www.example.com").with(:query => {:a => [5, "c d"]}).to_return(:body => "abc")
expect(http_request(:get, "http://www.example.com/?a[]=5&a[]=c%20d").body).to eq("abc")
end

it "converts hash values into strings" do
stub_request(:get, "www.example.com").with(:query => {"a" => [5, "c d"]}).to_return(:body => "abc")
expect(http_request(:get, "http://www.example.com/?a[]=5&a[]=c%20d").body).to eq("abc")

Expand Down

0 comments on commit fa4583c

Please sign in to comment.