Skip to content

Commit

Permalink
A test to demonstrate tildeio#125
Browse files Browse the repository at this point in the history
  • Loading branch information
Amiel Martin committed Dec 23, 2016
1 parent 7cd90bf commit 95ec725
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/recognizer-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,14 @@ QUnit.test("Dynamic routes without leading `/` and single length param are recog
resultsMatch(assert, router.recognize("foo/1"), [{ handler: handler, params: { id: "1" }, isDynamic: true }]);
});

// BUG: https://github.com/tildeio/route-recognizer/issues/125
QUnit.test("Dynamic routes with a trailing extension", (assert: Assert) => {
let handler = {};
let router = new RouteRecognizer();

router.add([{ path: "/foo/:id.json", handler: handler }]);
resultsMatch(assert, router.recognize("/foo/1.json"), [{ handler: handler, params: { id: "1" }, isDynamic: true }]);
});

QUnit.module("Route Generation", hooks => {
let router: RouteRecognizer;
Expand Down

0 comments on commit 95ec725

Please sign in to comment.