From c9a3f5b1cdad9fcb9a06a83ffcc29faa94f3b704 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 24 Jan 2013 14:30:20 +0100 Subject: [PATCH] added RegistrationStatus array --- app/js/controllers.js | 3 ++- app/js/services.js.ep | 4 ++++ test/unit/servicesSpec.js | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 8449eee..0576a11 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -2,7 +2,7 @@ /* Controllers */ -function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $route, Organizations) { +function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $route, Organizations, RegistrationStatus) { $scope.$routeParams = $routeParams; $scope.$location = $location; @@ -11,6 +11,7 @@ function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $ $scope.organizations = data; $log.info('organizations promise ', $scope.organizations); }); + $scope.RegistrationStatus = RegistrationStatus; $scope.update = function(registration, state) { diff --git a/app/js/services.js.ep b/app/js/services.js.ep index 2545b4d..955a7e0 100644 --- a/app/js/services.js.ep +++ b/app/js/services.js.ep @@ -65,4 +65,8 @@ angular.module('myApp.services', [ 'ngResource' ]). }; return $scope.organizations; + }). +/* http://jsfiddle.net/asgoth/7bNAd/ */ + value('RegistrationStatus', function() { + return [ 'draft', 'confirmation', 'verified' ]; }); diff --git a/test/unit/servicesSpec.js b/test/unit/servicesSpec.js index 7c5033e..da1effd 100644 --- a/test/unit/servicesSpec.js +++ b/test/unit/servicesSpec.js @@ -18,4 +18,11 @@ describe('service', function() { expect(RegistrationTypes[0].css_class).toBeDefined(); })); }); + + describe('RegistrationStatus', function() { + it('have status', inject(function(RegistrationStatus) { + expect(RegistrationStatus().length).toBe(3); + })); + }); + }); -- 2.20.1