Route declaration must start with / fixes #242

This commit is contained in:
sdogruyol 2016-11-04 11:12:35 +03:00
parent 7dd834ad28
commit e6810c4516
5 changed files with 24 additions and 0 deletions

View file

@ -13,5 +13,13 @@ describe "Route" do
client_response = call_request_on_app(request)
client_response.body.should eq("Route 2")
end
it "doesn't allow a route declaration start without /" do
expect_raises Kemal::Exceptions::PathStartInvalidException, "Route declaration get \"route\" needs to start with '/', should be get \"/route\"" do
get "route" do |env|
"Route 1"
end
end
end
end
end