expect( scope.ValidStates ).toBeTruthy();
});
});
+
+
+describe('AuthorsCtrl', function(){
+ var scope, $httpBackend;
+
+ beforeEach(module('myApp'));
+
+ beforeEach(inject(function($injector) {
+ $httpBackend = $injector.get('$httpBackend');
+ $httpBackend.whenJSONP(/authors/).passThrough();
+ }));
+ afterEach(function() {
+ $httpBackend.verifyNoOutstandingExpectation();
+ $httpBackend.verifyNoOutstandingRequest();
+ });
+
+ beforeEach(inject(function($rootScope, $controller){
+ scope = $rootScope.$new();
+ var ctrl = $controller(AuthorsCtrl, { $scope: scope } );
+ }));
+
+
+ it('ready', function() {
+ $httpBackend.flush();
+ expect( scope.ready ).toBe( true );
+ });
+
+ it('data', function() {
+ $httpBackend.flush();
+ expect( scope.data ).toBeTruthy();
+ });
+});