Commit d1fc57e3 authored by Terence Lee's avatar Terence Lee

add custom route test

parent 0c7f7f53
{
"routes": {
"/*.html": "index.html",
"/route/**": "route.html"
}
}
...@@ -41,4 +41,22 @@ describe "Simple" do ...@@ -41,4 +41,22 @@ describe "Simple" do
expect(response.body.chomp).to eq("foobar") expect(response.body.chomp).to eq("foobar")
end end
end end
describe "routes" do
let(:name) { "routes" }
it "should support custom routes" do
response = app.get("/foo.html")
expect(response.code).to eq("200")
expect(response.body.chomp).to eq("hello world")
response = app.get("/route/foo")
expect(response.code).to eq("200")
expect(response.body.chomp).to eq("hello from route")
response = app.get("/route/foo/bar")
expect(response.code).to eq("200")
expect(response.body.chomp).to eq("hello from route")
end
end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment