]> khamidou — GitHub mirrors - kite.git/commitdiff
wip - learning ng testing
authorkarim hamidou <khamidou@gmail.com>
Fri, 18 Oct 2013 19:54:51 +0000 (21:54 +0200)
committerkarim hamidou <khamidou@gmail.com>
Fri, 18 Oct 2013 19:54:51 +0000 (21:54 +0200)
src/front/test/unit/controllers.spec.js

index 6b6c07851eee8d3d93b5acafb0444d11b3a639bd..185a26d30e0c7c84dc03a5b4dd6c9d37f487e944 100644 (file)
@@ -5,11 +5,14 @@
 describe('controllers', function(){
     beforeEach(module('KiteMail.controllers'));
 
+    
     describe('MailsListController', function() {
-        it('should do an ajax request to query mails', inject(function($controller, $httpBackend) {
-            var scope = {};
-            this.$httpBackend.expectGET('/karim/mail', 200);
-            var ctrl = $controller("MailsListController", {$scope: scope})
+        it('should do an ajax request to query mails', inject(function($injector) {
+            var $httpBackend = $injector.get('$httpBackend');
+            $httpBackend.expectGET('/karim/mail', 200);
+
+            var $rootScope = $injector.get('$rootScope');
+            var ctrl = $injector.get("MailsListController", {$scope: $rootScope})
             this.$httpBackend.flush();
         }));