Skip to content

Commit

Permalink
Fixing tests related to Hash ordering in rbx 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
trobrock committed Jul 4, 2012
1 parent fb8dc73 commit a47a056
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
require 'shoulda'
require 'matchy'
require 'mocha'
require 'cgi'

require File.expand_path('../../lib/etsy', __FILE__)

class Test::Unit::TestCase


def raw_fixture_data(filename)
file = File.dirname(__FILE__) + "/fixtures/#{filename}"
File.read(file)
Expand Down
8 changes: 5 additions & 3 deletions test/unit/etsy/request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ class RequestTest < Test::Unit::TestCase
should "be able to request a single association" do
r = Request.new('/foo', {:includes => 'Thunder'})
r.stubs(:parameters).with().returns({:a => :b})
r.query.should == 'a=b&includes=Thunder'
CGI.parse(r.query).should == { "a" => ["b"], "includes" => ["Thunder"] }
end

should "be able make simplified association requests" do
r = Request.new('/foo', {:includes => ['Thunder', 'Lightning']})
r.stubs(:parameters).with().returns({:a => :b})
r.query.should == 'a=b&includes=Thunder%2CLightning'
CGI.parse(r.query).should == { "a" => ["b"], "includes" => ["Thunder,Lightning"] }
end

should "be able to generate detailed association queries" do
Expand Down Expand Up @@ -107,7 +107,9 @@ class RequestTest < Test::Unit::TestCase
r = Request.new('/foo', params)
r.stubs(:base_path).with().returns('/base')
r.stubs(:parameters).with().returns(:a => 'b')
r.endpoint_url.should == '/base/foo?a=b&includes=Lightning%2CThunder'
uri = URI.parse(r.endpoint_url)
uri.path.should == '/base/foo'
CGI.parse(uri.query).should == { "a" => ["b"], "includes" => ["Lightning,Thunder"] }
end

should "be able to determine the endpoint URI when in read-only mode" do
Expand Down

0 comments on commit a47a056

Please sign in to comment.