Skip to content

Commit

Permalink
fix: ut abe user
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Nov 25, 2016
1 parent 015dfc8 commit 2d89cf9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/cli/users/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ export function loginLimitTry(username) {
}
})
}catch(e) {
console.log('loginLimitTry', e)
resolve()
}
})
Expand Down
27 changes: 26 additions & 1 deletion test/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ describe('users', function() {
chai.expect(res.length).to.be.above(0)

// unstub
sinon.assert.calledOnce(User.manager.instance.read)
User.manager.instance.read.restore()
})

Expand Down Expand Up @@ -473,4 +472,30 @@ describe('users', function() {
sinon.assert.calledOnce(User.manager.instance.save)
User.manager.instance.save.restore()
})

it('User.utils.getUserWorkflow', function(){
// stub

// test
config.users.enable = false
var res = User.utils.getUserWorkflow()
chai.expect(res.length).to.be.equal(2)

config.users.enable = true
var res = User.utils.getUserWorkflow("draft", "admin")
chai.expect(res.length).to.be.equal(2)
// unstub
})

it('User.utils.loginLimitTry', function(done){
// stub

// test
var res = User.utils.loginLimitTry()
.then(function () {
done()
})

// unstub
})
});

0 comments on commit 2d89cf9

Please sign in to comment.