added RegistrationStatus array
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 24 Jan 2013 13:30:20 +0000 (14:30 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 24 Jan 2013 13:30:20 +0000 (14:30 +0100)
app/js/controllers.js
app/js/services.js.ep
test/unit/servicesSpec.js

index 8449eee..0576a11 100644 (file)
@@ -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) {
 
index 2545b4d..955a7e0 100644 (file)
@@ -65,4 +65,8 @@ angular.module('myApp.services', [ 'ngResource' ]).
                };
 
                return $scope.organizations;
+       }).
+/* http://jsfiddle.net/asgoth/7bNAd/ */
+       value('RegistrationStatus', function() {
+               return [ 'draft', 'confirmation', 'verified' ];
        });
index 7c5033e..da1effd 100644 (file)
@@ -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);
+               }));
+       });
+
 });