diff --git a/client/group.js b/client/group.js index 8b5a000..78a7bf8 100644 --- a/client/group.js +++ b/client/group.js @@ -8,6 +8,7 @@ Group = function(router, options, parent) { this._router = router; this.prefix = options.prefix || ''; + this.name = options.name; this._triggersEnter = options.triggersEnter || []; this._triggersExit = options.triggersExit || []; diff --git a/package.js b/package.js index dfeb2e9..b4b14ed 100644 --- a/package.js +++ b/package.js @@ -42,7 +42,7 @@ Package.onTest(function(api) { api.addFiles('test/client/triggers.js', 'client'); api.addFiles('test/server/plugins/fast_render.js', 'server'); - + api.addFiles('test/common/router.path.spec.js', ['client', 'server']); api.addFiles('test/common/router.addons.spec.js', ['client', 'server']); api.addFiles('test/common/route.spec.js', ['client', 'server']); diff --git a/test/client/group.spec.js b/test/client/group.spec.js index 492d5e4..73e870b 100644 --- a/test/client/group.spec.js +++ b/test/client/group.spec.js @@ -69,3 +69,21 @@ Tinytest.addAsync('Client - Group - subscribe', function (test, next) { next(); }, 100); }); + + +Tinytest.addAsync('Client - Group - set and retrieve group name', function (test, next) { + var rand = Random.id(); + var name = Random.id(); + + var group = FlowRouter.group({ + name: name + }); + + group.route('/' + rand); + + FlowRouter.go('/' + rand); + setTimeout(function() { + test.isTrue(FlowRouter.current().route.group.name === name); + next(); + }, 100); +});