1
0
mirror of https://github.com/moparisthebest/mail synced 2025-02-16 15:10:10 -05:00

fix wrong api usage in login initial controller

This commit is contained in:
Felix Hammerl 2013-12-05 16:32:12 +01:00
parent 9a8e6ff3dd
commit f3ef8fdf91
2 changed files with 9 additions and 3 deletions

View File

@ -35,7 +35,9 @@ define(function(require) {
$scope.setState(states.PROCESSING);
setTimeout(function() {
emailDao.unlock({}, passphrase, function(err) {
emailDao.unlock({
passphrase: passphrase
}, function(err) {
if (err) {
$scope.setState(states.IDLE);
$scope.onError(err);

View File

@ -67,7 +67,9 @@ define(function(require) {
it('should unlock crypto', function(done) {
scope.state.passphrase = passphrase;
scope.state.confirmation = passphrase;
emailDaoMock.unlock.withArgs({}, passphrase).yields();
emailDaoMock.unlock.withArgs({
passphrase: passphrase
}).yields();
setStateStub = sinon.stub(scope, 'setState', function(state) {
if (setStateStub.calledOnce) {
expect(state).to.equal(2);
@ -92,7 +94,9 @@ define(function(require) {
it('should not work when keypair generation fails', function(done) {
scope.state.passphrase = passphrase;
scope.state.confirmation = passphrase;
emailDaoMock.unlock.withArgs({}, passphrase).yields(new Error('asd'));
emailDaoMock.unlock.withArgs({
passphrase: passphrase
}).yields(new Error('asd'));
setStateStub = sinon.stub(scope, 'setState', function(state) {
if (setStateStub.calledOnce) {
expect(state).to.equal(2);