Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Hash serialization on tests with OAuth2MacClient: "excise webmock from the oauth client" #52

Closed
denyago opened this issue Sep 20, 2012 · 1 comment

Comments

@denyago
Copy link
Contributor

denyago commented Sep 20, 2012

WebMock normalizes uri in a way, Rack can't parse correctly. But OAuth2MacClient relies on WebMock.

The limitation is: Hashes with digits as keys: {:digits => {'1' => 'One, '2' => 'Two'}}. In tests, they will be treated as {:digits => ['One', 'Two']}.

More information can be found here: #51

The case is:

WebMock::Util::URI.normalize_uri("e.com?a[]=b&a[]=c") 
#=> ...a%5B0%5D=b&a%5B1%5D=c <- it added 0 and 1

Rack::Utils.parse_nested_query("a%5B0%5D=b&a%5B1%5D=c") 
#=> {"a"=>{"0"=>"b", "1"=>"c"}} <- this is wrong: it must be {"a"=>["b", "c"]}

So, unfortunatly, I've added hack to remove digits, put by WebMock: denyago@69b6222#L1R57

@oestrich
Copy link
Contributor

Closing due to age.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants