Skip to content

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

Closed
@denyago

Description

@denyago

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions