change names in services

This commit is contained in:
Matias Alejo Garcia 2014-06-03 17:42:36 -03:00
parent ac58d9744e
commit 77f6a8221a
20 changed files with 53 additions and 59 deletions

View File

@ -26,37 +26,13 @@ var copayApp = window.copayApp = angular.module('copayApp',[
'monospaced.qrcode',
'notifications',
'copayApp.filters',
'copayApp.header',
'copayApp.footer',
'copayApp.addresses',
'copayApp.transactions',
'copayApp.send',
'copayApp.backup',
'copayApp.walletFactory',
'copayApp.signin',
'copayApp.socket',
'copayApp.controllerUtils',
'copayApp.setup',
'copayApp.controllers',
'copayApp.directives',
'copayApp.video',
'copayApp.import',
'copayApp.passphrase',
'copayApp.settings'
'copayApp.services',
]);
angular.module('copayApp.header', []);
angular.module('copayApp.footer', []);
angular.module('copayApp.addresses', []);
angular.module('copayApp.transactions', []);
angular.module('copayApp.send', []);
angular.module('copayApp.backup', []);
angular.module('copayApp.walletFactory', []);
angular.module('copayApp.controllerUtils', []);
angular.module('copayApp.signin', []);
angular.module('copayApp.setup', []);
angular.module('copayApp.socket', []);
angular.module('copayApp.filters', []);
angular.module('copayApp.controllers', []);
angular.module('copayApp.directives', []);
angular.module('copayApp.video', []);
angular.module('copayApp.import', []);
angular.module('copayApp.passphrase', []);
angular.module('copayApp.settings', []);
angular.module('copayApp.services', []);

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.addresses').controller('AddressesController',
angular.module('copayApp.controllers').controller('AddressesController',
function($scope, $rootScope, $timeout, controllerUtils) {
$scope.loading = false;
var w = $rootScope.wallet;

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.backup').controller('BackupController',
angular.module('copayApp.controllers').controller('BackupController',
function($scope, $rootScope, $location, $window, $timeout, $modal) {
$scope.title = 'Backup';

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.footer').controller('FooterController', function($rootScope, $sce, $scope, $http) {
angular.module('copayApp.controllers').controller('FooterController', function($rootScope, $sce, $scope, $http) {
if (config.themes && Array.isArray(config.themes) && config.themes[0]) {
$scope.themes = config.themes;

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.header').controller('HeaderController',
angular.module('copayApp.controllers').controller('HeaderController',
function($scope, $rootScope, $location, $notification, $http, walletFactory, controllerUtils) {
$scope.menu = [
{

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.import').controller('ImportController',
angular.module('copayApp.controllers').controller('ImportController',
function($scope, $rootScope, walletFactory, controllerUtils, Passphrase) {
$scope.title = 'Import a backup';
var reader = new FileReader();

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.send').controller('SendController',
angular.module('copayApp.controllers').controller('SendController',
function($scope, $rootScope, $window, $location, $timeout) {
$scope.title = 'Send';
$scope.loading = false;

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.settings').controller('SettingsController',
angular.module('copayApp.controllers').controller('SettingsController',
function($scope, $rootScope, $window, $location) {
$scope.title = 'Settings';

View File

@ -32,7 +32,7 @@ var valid_pairs = {
'1,12': 489
};
angular.module('copayApp.setup').controller('SetupController',
angular.module('copayApp.controllers').controller('SetupController',
function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase) {
$rootScope.videoInfo = {};

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.signin').controller('SigninController',
angular.module('copayApp.controllers').controller('SigninController',
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) {
var cmp = function(o1, o2){
var v1 = o1.show.toLowerCase(), v2 = o2.show.toLowerCase();

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.transactions').controller('TransactionsController',
angular.module('copayApp.controllers').controller('TransactionsController',
function($scope, $rootScope, $timeout, controllerUtils) {
$scope.title = 'Transactions';

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllerUtils')
angular.module('copayApp.services')
.factory('controllerUtils', function($rootScope, $sce, $location, $notification, Socket, video) {
var root = {};
var bitcore = require('bitcore');

View File

@ -1,3 +1,4 @@
'use strict';
angular.module('copayApp.passphrase').value('Passphrase', new copay.Passphrase(config.passphrase));
angular.module('copayApp.services')
.value('Passphrase', new copay.Passphrase(config.passphrase));

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.socket').factory('Socket',
angular.module('copayApp.services').factory('Socket',
function($rootScope) {
var listeners = [];
var url = 'http://' + config.socket.host + ':' + config.socket.port;

View File

@ -93,4 +93,4 @@ Video.prototype.close = function() {
this.mediaConnections = {};
};
angular.module('copayApp.video').value('video', new Video());
angular.module('copayApp.services').value('video', new Video());

View File

@ -1,4 +1,4 @@
'use strict';
angular.module('copayApp.walletFactory').value('walletFactory', new copay.WalletFactory(config, copay.version));
angular.module('copayApp.services').value('walletFactory', new copay.WalletFactory(config, copay.version));

View File

@ -47,8 +47,6 @@ module.exports = function(config) {
//Mocha stuff
'test/mocha.conf.js',
//test files
'test/unit/**/*.js',
//App-specific Code
'js/app.js',
@ -57,7 +55,11 @@ module.exports = function(config) {
'js/filters.js',
'js/services/*.js',
'js/controllers/*.js',
'js/init.js'
'js/init.js',
//test files
'test/unit/**/*.js'
],

View File

@ -3,13 +3,31 @@
//
describe("Unit: Testing Controllers", function() {
// beforeEach(module('copay'));
beforeEach(module('copay.signin'));
beforeEach(module('notifications'));
beforeEach(module('copayApp.services'));
beforeEach(module('copayApp.controllers'));
var scope, addressCtrl;
//
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
addressCtrl = $controller('AddressesController', {
$scope: scope,
});
}));
it('should have a AddressesController controller', function() {
console.log('[controllersSpec.js.10:copayApp:]',copayApp.controller); //TODO
expect(copayApp.AddressesController).not.to.equal(null);
expect(scope.loading).equal(false);
});
it('selectedAddr should modify scope', function() {
expect(scope.selectedAddress).equal(undefined);
scope.selectAddress('hola');
expect(scope.selectedAddr).equal('hola');
});
//
// it('should have a BackupController controller', function() {
// expect(copayApp.Backupcontroller).not.to.equal(null);

View File

@ -6,7 +6,7 @@ describe("Unit: Testing Directives", function() {
var $scope, form;
beforeEach(module('copay.directives'));
beforeEach(module('copayApp.directives'));
describe('Validate Address', function() {
beforeEach(inject(function($compile, $rootScope) {

View File

@ -3,22 +3,19 @@
//
describe("Unit: Testing Services", function() {
beforeEach(angular.mock.module('copay.socket'));
beforeEach(angular.mock.module('copayApp.services'));
it('should contain a Socket service', inject(function(Socket) {
expect(Socket).not.to.equal(null);
}));
beforeEach(angular.mock.module('copay.walletFactory'));
it('should contain a walletFactory service', inject(function(walletFactory) {
expect(walletFactory).not.to.equal(null);
}));
// TODO
/*beforeEach(angular.mock.module('copay.controllerUtils'));
/*beforeEach(angular.mock.module('copayApp.controllerUtils'));
it('should contain a controllerUtils service', inject(function(controllerUtils) {
expect(controllerUtils).not.to.equal(null);