Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhammond committed Aug 16, 2016
1 parent 93e53f9 commit 6d772c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/unit/recognizer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,16 @@ test("Nested routes recognize", function(assert) {
assert.equal(router.hasRoute('bar'), false);
});

test("Nested epsilon routes recognize.", function(assert) {
var router = new RouteRecognizer();
router.add([{"path":"/","handler":"application"},{"path":"/","handler":"test1"},{"path":"/test2","handler":"test1.test2"}]);
router.add([{"path":"/","handler":"application"},{"path":"/","handler":"test1"},{"path":"/","handler":"test1.index"}]);
router.add([{"path":"/","handler":"application"},{"path":"/","handler":"test1"},{"path":"/","handler":"test1.index"}]);
router.add([{"path":"/","handler":"application"},{"path":"/:param","handler":"misc"}], {"as":"misc"});

resultsMatch(assert, router.recognize("/test2"), [{ "handler": "application", "isDynamic": false, "params": {} }, { "handler": "test1", "isDynamic": false, "params": {} }, { "handler": "test1.test2", "isDynamic": false, "params": {} }]);
});

test("Nested routes with query params recognize", function(assert) {
var handler1 = { handler: 1 };
var handler2 = { handler: 2 };
Expand Down

0 comments on commit 6d772c9

Please sign in to comment.