Accepts requests with query string

This commit is contained in:
Juan Wajnerman 2015-05-29 18:21:15 -03:00
parent 7e841a88b2
commit 8b1447b68d
3 changed files with 23 additions and 1 deletions

View file

@ -11,6 +11,16 @@ describe "Frank::Handler" do
response.body.should eq("hello")
end
it "routes request with query string" do
frank = Frank::Handler.new
frank.add_route "GET", "/" do |ctx|
"hello #{ctx.params["message"]}"
end
request = HTTP::Request.new("GET", "/?message=world")
response = frank.call(request)
response.body.should eq("hello world")
end
it "sets content type" do
frank = Frank::Handler.new
frank.add_route "GET", "/" do |env|