In Ruby 1.8.x Hash is ordered by default. So this test will fail.
The best will be to parse uri here, get query, parse it as well and test hash.

``` ruby
params = CGI.parse URI.parse(uri.to_s).query
expect(params).to eq "foo" => "bar", "baz" => "quux"
```