diff --git a/public/views/preferencesHistory.html b/public/views/preferencesHistory.html
index f53667b15..c482def3a 100644
--- a/public/views/preferencesHistory.html
+++ b/public/views/preferencesHistory.html
@@ -6,7 +6,7 @@
-
+
-
Export to file
diff --git a/src/js/controllers/preferencesHistory.js b/src/js/controllers/preferencesHistory.js
index e3285b9e5..1f988971d 100644
--- a/src/js/controllers/preferencesHistory.js
+++ b/src/js/controllers/preferencesHistory.js
@@ -6,9 +6,7 @@ angular.module('copayApp.controllers').controller('preferencesHistory',
var c = fc.credentials;
$scope.csvReady = false;
- $scope.csvHistory = function(isUpdating, cb) {
- if (isUpdating) return;
-
+ $scope.csvHistory = function(cb) {
var allTxs = [];
function getHistory(cb) {
diff --git a/test/controllers/backup.test.js b/test/controllers/backup.test.js
index 2a62b5310..d1417e126 100644
--- a/test/controllers/backup.test.js
+++ b/test/controllers/backup.test.js
@@ -16,9 +16,10 @@ describe('Backup Controller', function() {
it('should be defined', function() {
should.exist(ctrl);
});
+
it('should set the mnemonic incomplete wallets', function(done) {
- should.exist(ctrl);
- ctrl.mnemonicWords.should.deep.equal('dizzy cycle skirt decrease exotic fork sure mixture hair vapor copper hero'.split(' '));
+ should.exist(scope.mnemonicWords);
+ scope.mnemonicWords.should.deep.equal('dizzy cycle skirt decrease exotic fork sure mixture hair vapor copper hero'.split(' '));
done();
});
});
@@ -35,11 +36,11 @@ describe('Backup Controller', function() {
});
it('should not set the mnemonic for complete wallets', function() {
- ctrl.mnemonicWords.should.deep.equal('cheese where alarm job conduct donkey license pave congress pepper fence current'.split(' '));
+ scope.mnemonicWords.should.deep.equal('cheese where alarm job conduct donkey license pave congress pepper fence current'.split(' '));
});
it('should set main wallet info', function(done) {
- ctrl.walletName.should.equal('kk');
+ scope.walletName.should.equal('kk');
done();
});
});
diff --git a/test/controllers/preferencesHistory.test.js b/test/controllers/preferencesHistory.test.js
index 5c991f844..8c8ec6d3a 100644
--- a/test/controllers/preferencesHistory.test.js
+++ b/test/controllers/preferencesHistory.test.js
@@ -18,11 +18,17 @@ describe('Preferences History Controller', function() {
mocks.clear({}, done);
});
+ it('should be defined', function() {
+ should.exist(ctrl);
+ });
+
it('should export csv', function(done) {
- ctrl.csvHistory(function(err) {
+ scope.csvHistory(function(err) {
should.not.exist(err);
- ctrl.csvReady.should.equal(true);
- JSON.stringify(ctrl.csvContent).should.equal('[{"Date":"2016-06-03T15:54:51.000Z","Destination":"","Description":"","Amount":"0.00120000","Currency":"BTC","Txid":"bf31ecaa8e10ce57f9a889fc4c893b40ff57b016dd763957d942e21ed55fc62c","Creator":"","Copayers":"","Comment":"just a comment"}]');
+ should.exist(scope.csvReady);
+ scope.csvReady.should.equal(true);
+ should.exist(scope.csvContent);
+ JSON.stringify(scope.csvContent).should.equal('[{"Date":"2016-06-03T15:54:51.000Z","Destination":"","Description":"","Amount":"0.00120000","Currency":"BTC","Txid":"bf31ecaa8e10ce57f9a889fc4c893b40ff57b016dd763957d942e21ed55fc62c","Creator":"","Copayers":"","Comment":"just a comment"}]');
done();
});
});