spec/http2_spec.rb in http2-0.0.6 vs spec/http2_spec.rb in http2-0.0.9
- old
+ new
@@ -8,11 +8,11 @@
raise "Expected 'test1=test2' but got: '#{res}'." if res != "test1=test2"
res = Http2.post_convert_data(
"test1" => [1, 2, 3]
)
- raise "Expected 'test1%5B0%5D=1test1%5B1%5D=2test1%5B2%5D=3' but got: '#{res}'." if res != "test1%5B0%5D=1test1%5B1%5D=2test1%5B2%5D=3"
+ raise "Expected 'test1%5B0%5D=1&test1%5B1%5D=2&test1%5B2%5D=3' but got: '#{res}'." if res != "test1%5B0%5D=1&test1%5B1%5D=2&test1%5B2%5D=3"
res = Http2.post_convert_data(
"test1" => {
"order" => {
[:Bnet_profile, "profile_id"] => 5
@@ -43,19 +43,21 @@
"val7" => [
{
"val8" => "test8"
}
]
- }
+ },
+ "val9" => ["a", "b", "d"]
})
res = JSON.parse(resp.body)
raise "Expected 'res' to be a hash." if !res.is_a?(Hash)
raise "Error 1" if res["val1"] != "test1"
raise "Error 2" if res["val2"] != "test2"
raise "Error 3" if !res["val3"] or res["val3"][0] != "test3"
raise "Error 4" if res["val4"]["val5"] != "test5"
raise "Error 5" if res["val6"]["val7"][0]["val8"] != "test8"
+ raise "Array error: '#{res["val9"]}'." if res["val9"][0] != "a" or res["val9"][1] != "b" or res["val9"][2] != "d"
end
end
end
it "should be able to do multipart-requests and keep-alive when using multipart." do
\ No newline at end of file