kemal/spec/route_spec.cr
2016-01-13 10:09:12 +02:00

18 lines
439 B
Crystal

require "./spec_helper"
describe "Route" do
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
end
end