Skip to content

Commit ae6332d

Browse files
committed
simple spec for matching a route with one variable
1 parent 06438ae commit ae6332d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/amber_router/route_set/matching/routes_with_variables_spec.cr

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
require "../../../spec_helper"
22

33
describe "routes with variables" do
4+
it "routes correctly with variables" do
5+
router = build do
6+
add "/get/users/:id", :user_path
7+
end
8+
9+
result = router.find "/get/users/3"
10+
result.payload?.should eq :user_path
11+
end
12+
413
it "routes many variables" do
514
router = build do
615
add "/get/var/:b/:c/:d/:e/:f/:g/:h/:i/:j/:k/:l/:m/:n/:o/:p/:q/:r/:s/:t/:u/:v/:w/:x/:y/:z", :variable_alphabet

0 commit comments

Comments
 (0)