mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Formatted
This commit is contained in:
parent
f82a57b2a4
commit
da23d397c6
1 changed files with 8 additions and 8 deletions
|
@ -3,9 +3,9 @@ require "./spec_helper"
|
|||
describe "ParamParser" do
|
||||
it "parses query params" do
|
||||
route = Route.new "POST", "/" do |env|
|
||||
hasan = env.params["hasan"]
|
||||
"Hello #{hasan}"
|
||||
end
|
||||
hasan = env.params["hasan"]
|
||||
"Hello #{hasan}"
|
||||
end
|
||||
request = HTTP::Request.new("POST", "/?hasan=cemal")
|
||||
params = Kemal::ParamParser.new(route, request).parse
|
||||
params["hasan"].should eq "cemal"
|
||||
|
@ -13,11 +13,11 @@ describe "ParamParser" do
|
|||
|
||||
it "parses request body" do
|
||||
route = Route.new "POST", "/" do |env|
|
||||
name = env.params["name"]
|
||||
age = env.params["age"]
|
||||
hasan = env.params["hasan"]
|
||||
"Hello #{name} #{hasan} #{age}"
|
||||
end
|
||||
name = env.params["name"]
|
||||
age = env.params["age"]
|
||||
hasan = env.params["hasan"]
|
||||
"Hello #{name} #{hasan} #{age}"
|
||||
end
|
||||
request = HTTP::Request.new("POST", "/?hasan=cemal", body: "name=serdar&age=99")
|
||||
params = Kemal::ParamParser.new(route, request).parse
|
||||
params.should eq({"hasan" => "cemal", "name" => "serdar", "age" => "99"})
|
||||
|
|
Loading…
Reference in a new issue