Permalink
Browse files

test with addRole()

  • Loading branch information...
1 parent cca6ab6 commit 7d7eaa4551403f252d89626d2e717f87d2a76c37 @carlos8f committed Mar 5, 2013
Showing with 5 additions and 6 deletions.
  1. +1 −1 context.js
  2. +4 −5 test/common.js
View
2 context.js
@@ -14,7 +14,7 @@ function copy (obj) {
function Context (name, structure) {
this.name = name;
- this.roles = copy(structure);
+ this.roles = copy(structure) || {};
this.update();
}
module.exports = Context;
View
9 test/common.js
@@ -17,11 +17,10 @@ doBasicTest = function (store, options) {
if (store) {
relations.use(relations.stores[store], options);
}
- relations.define('repos', {
- owner: ['pull', 'push', 'administrate'],
- collaborator: ['pull', 'push'],
- watcher: ['pull']
- });
+ relations.define('repos');
+ relations.repos.addRole('owner', ['pull', 'push', 'administrate']);
+ relations.repos.addRole('collaborator', ['pull', 'push']);
+ relations.repos.addRole('watcher', ['pull']);
relations.repos('%s is the owner of %s', carlos, buffet);
relations.repos('%s is a collaborator of %s', carlos, views);

0 comments on commit 7d7eaa4

Please sign in to comment.