Skip to content

Commit 48d5e33

Browse files
committed
Update helpers.js
You might need to pass more parameters in role if you extend built-in role model
1 parent 5e0528a commit 48d5e33

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/helpers.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ _beforeEach.givenUser = function(attrs, optionalHandler) {
128128
}
129129

130130
_beforeEach.givenUserWithRole = function (attrs, role, optionalHandler) {
131+
if (typeof role === 'string') {
132+
role = {
133+
name: role
134+
}
135+
}
131136
_beforeEach.givenUser(attrs, function (done) {
132137
var test = this;
133138
test.app.models.Role.create({name: role}, function (err, result) {

0 commit comments

Comments
 (0)