Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Rename Account.setSignature to Account.setSecondSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed May 5, 2017
1 parent 9dca9e5 commit 8d18079
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/components/main/setSecondPassDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ app.directive('setSecondPass', (setSecondPass, Account, $rootScope, success, err
});

scope.passConfirmSubmit = (secondsecret) => {
Account.setSignature(secondsecret, attrs.publicKey, attrs.passphrase)
Account.setSecondSecret(secondsecret, attrs.publicKey, attrs.passphrase)
.then(() => {
success.dialog('Your second passphrase was successfully registered.');
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ app.factory('Account', function ($rootScope, $peers, $q) {
offset,
});

this.setSignature = (secondSecret, publicKey, secret) => $peers.sendRequestPromise(
this.setSecondSecret = (secondSecret, publicKey, secret) => $peers.sendRequestPromise(
'signatures', { secondSecret, publicKey, secret });

return this;
Expand Down
12 changes: 6 additions & 6 deletions src/test/components/main/setSecondPassDirective.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('setSecondPass Directive', () => {
it('listens for an onAfterSignup event', () => {
const mock = sinon.mock(account);
const deffered = $q.defer();
mock.expects('setSignature').returns(deffered.promise);
mock.expects('setSecondSecret').returns(deffered.promise);

const spy = sinon.spy(success, 'dialog');

Expand All @@ -68,10 +68,10 @@ describe('setSecondPass Directive', () => {
});

describe('scope.passConfirmSubmit', () => {
it('should call account.setSignature', () => {
it('should call account.setSecondSecret', () => {
const mock = sinon.mock(account);
const deffered = $q.defer();
mock.expects('setSignature').returns(deffered.promise);
mock.expects('setSecondSecret').returns(deffered.promise);

const spy = sinon.spy(success, 'dialog');
$scope.passConfirmSubmit();
Expand All @@ -85,7 +85,7 @@ describe('setSecondPass Directive', () => {
it('should show error dialog if trying to set second passphrase multiple times', () => {
const mock = sinon.mock(account);
const deffered = $q.defer();
mock.expects('setSignature').returns(deffered.promise);
mock.expects('setSecondSecret').returns(deffered.promise);

const spy = sinon.spy(error, 'dialog');
$scope.passConfirmSubmit();
Expand All @@ -106,7 +106,7 @@ describe('setSecondPass Directive', () => {
it('should show error dialog if account does not have enough LSK', () => {
const mock = sinon.mock(account);
const deffered = $q.defer();
mock.expects('setSignature').returns(deffered.promise);
mock.expects('setSecondSecret').returns(deffered.promise);

const spy = sinon.spy(error, 'dialog');
$scope.passConfirmSubmit();
Expand All @@ -119,7 +119,7 @@ describe('setSecondPass Directive', () => {
it('should show error dialog for all the other errors', () => {
const mock = sinon.mock(account);
const deffered = $q.defer();
mock.expects('setSignature').returns(deffered.promise);
mock.expects('setSecondSecret').returns(deffered.promise);

const spy = sinon.spy(error, 'dialog');
$scope.passConfirmSubmit();
Expand Down
4 changes: 2 additions & 2 deletions src/test/services/account.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Factory: Account', () => {
});
});

describe('setSignature(secondSecret, publicKey, secret)', () => {
describe('setSecondSecret(secondSecret, publicKey, secret)', () => {
it('returns $peers.sendRequestPromise(\'signatures\', { secondSecret, publicKey, secret });', () => {
const publicKey = '3ff32442bb6da7d60c1b7752b24e6467813c9b698e0f278d48c43580da972135';
const secret = 'wagon stock borrow episode laundry kitten salute link globe zero feed marble';
Expand All @@ -73,7 +73,7 @@ describe('Factory: Account', () => {
.withArgs('signatures', { secondSecret, publicKey, secret })
.returns(deffered.promise);

const promise = account.setSignature(secondSecret, publicKey, secret);
const promise = account.setSecondSecret(secondSecret, publicKey, secret);

expect(promise).to.equal(deffered.promise);
});
Expand Down

0 comments on commit 8d18079

Please sign in to comment.