Skip to content

Commit

Permalink
A test making sure you can make urls with falsey parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
TehShrike committed Jul 13, 2016
1 parent f598319 commit 650af6a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"combine-arrays": "~1.0.2",
"hash-brown-router": "~1.5.0",
"native-promise-only": "0.8.1",
"page-path-builder": "~1.0.2",
"page-path-builder": "~1.0.3",
"path-to-regexp-with-reversible-keys": "~1.0.3",
"then-denodeify": "1.0.0",
"xtend": "^4.0.0"
Expand Down
20 changes: 20 additions & 0 deletions test/make-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,23 @@ test('makePath inheriting parameters from the route by the time the activate fun

stateRouter.go('parent.child1', { someParam: 'totally' })
})

test('makePath with falsey parameters', function(t) {
var stateRouter = getTestState(t, null, {
pathPrefix: ''
}).stateRouter

stateRouter.addState({
name: 'whatever',
template: '',
route: '/timer/:week(\\d+)/:day(\\d+)'
})

var output = stateRouter.makePath('whatever', {
week: 0,
day: 0
})

t.equal(output, '/timer/0/0')
t.end()
})

0 comments on commit 650af6a

Please sign in to comment.