Skip to content

Commit 2ae1c1c

Browse files
committed
Replace call of login method on constructor
Replace call of login method on constructor. Besides that it fixes error messages like TypeError: undefined is not a function.
1 parent 8655d59 commit 2ae1c1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ _beforeEach.givenUserWithRole = function (attrs, role, optionalHandler) {
194194
_beforeEach.givenLoggedInUser = function(credentials, optionalHandler) {
195195
_beforeEach.givenUser(credentials, function(done) {
196196
var test = this;
197-
this.app.models[this.userModel].constructor.login(credentials, function(err, token) {
197+
this.app.models[this.userModel].login(credentials, function(err, token) {
198198
if(err) {
199199
done(err);
200200
} else {
@@ -217,7 +217,7 @@ _beforeEach.givenLoggedInUser = function(credentials, optionalHandler) {
217217
_beforeEach.givenLoggedInUserWithRole = function(credentials, role, optionalHandler){
218218
_beforeEach.givenUserWithRole(credentials, role, function(done) {
219219
var test = this;
220-
this.app.models[this.userModel].constructor.login(credentials, function(err, token) {
220+
this.app.models[this.userModel].login(credentials, function(err, token) {
221221
if(err) {
222222
done(err);
223223
} else {

0 commit comments

Comments
 (0)