Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add mocha test for where clauses with periods

  • Loading branch information...
commit 6f30ab5d11422a8dce749c127c832f030eecda82 1 parent 8bdf10c
@kieran authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 tests/mocha.coffee
View
18 tests/mocha.coffee
@@ -129,6 +129,24 @@ describe 'Barista', ->
assert.equal paramsIn[key], paramsOut[key]
+
+ describe 'a where clause with a period', ->
+
+ beforeEach ->
+ router.match('/sites/:id/edit','GET').to('sites.edit').where(id:/[\w.]+/)
+
+ it 'params should match', ->
+ paramsIn =
+ method: 'GET'
+ controller: 'sites'
+ action: 'edit'
+ id: 'site.ru'
+
+ paramsOut = router.first '/sites/site.ru/edit', 'GET'
+
+ for key, val of paramsIn
+ assert.equal paramsIn[key], paramsOut[key]
+
# describe 'a keyed route', ->
# it 'should not throw an exception', ->
# route = router.match '/:controller/:action/:id'
Please sign in to comment.
Something went wrong with that request. Please try again.