Skip to content

Commit

Permalink
Added nested array test
Browse files Browse the repository at this point in the history
  • Loading branch information
dleeman committed Mar 25, 2016
1 parent eb224dc commit 6309847
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/signature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@
"POST\n/some/path\nthings[][thing_1]=value1&things[][thing_2]=value2"
end

it "should generate correct string when query hash contains nested arrays" do
@request.query_hash = {
"things" => [{ "thing_1" => [["v1", "v1"]] }, { "thing_2" => [["v2", "v2"]] }]
}
@request.send(:string_to_sign).should ==
"POST\n/some/path\nthings[][thing_1][][]=v1&things[][thing_1][][]=v1"\
"&things[][thing_2][][]=v2&things[][thing_2][][]=v2"
end

# This may well change in auth version 2
it "should not escape keys or values in the query string" do
@request.query_hash = {
Expand Down

0 comments on commit 6309847

Please sign in to comment.