Skip to content

Commit 24d7451

Browse files
committed
add test to ensure module works with arrays
1 parent 28ed481 commit 24d7451

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/check_sorted_querystring_spec.rb

+13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@
1414
end
1515
end
1616

17+
it "should support arrays like parameters" do
18+
nginx_run_server do
19+
EventMachine.run do
20+
req = EventMachine::HttpRequest.new("#{nginx_address}/?a=2&c[]=3&=6&a=1&=5&b=2&c[]=1&c[]=2").get
21+
req.callback do
22+
expect(req).to be_http_status(200)
23+
expect(req.response).to be === '{"args": "a=2&c[]=3&=6&a=1&=5&b=2&c[]=1&c[]=2", "sorted_args": "=5&=6&a=1&a=2&b=2&c[]=1&c[]=2&c[]=3"}'
24+
EventMachine.stop
25+
end
26+
end
27+
end
28+
end
29+
1730
it "should filter specified parameters" do
1831
nginx_run_server({filter_parameter: ["c", "_"]}) do
1932
EventMachine.run do

0 commit comments

Comments
 (0)