kemal/spec/route_spec.cr

19 lines
439 B
Crystal
Raw Normal View History

require "./spec_helper"
2014-06-11 23:41:02 +00:00
describe "Route" do
2015-10-31 07:28:25 +00:00
describe "match?" do
it "matches the correct route" do
kemal = Kemal::Handler.new
kemal.add_route "GET", "/route1" do |env|
"Route 1"
end
kemal.add_route "GET", "/route2" do |env|
"Route 2"
end
request = HTTP::Request.new("GET", "/route2")
response = kemal.call(request)
response.body.should eq("Route 2")
end
2014-06-11 23:41:02 +00:00
end
end