YouAndWeb_TwoToc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
'use strict';
describe('Controller: MainCtrl', function() {
// load the controller's module
beforeEach(module('dashboardApp'));
beforeEach(module('stateMock'));
var MainCtrl;
var scope;
var state;
var $httpBackend;
// Initialize the controller and a mock scope
beforeEach(inject(function(_$httpBackend_, $controller, $rootScope, $state) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('/api/shows')
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
scope = $rootScope.$new();
state = $state;
MainCtrl = $controller('MainCtrl', {
$scope: scope
});
}));
it('should attach a list of shows to the scope', function() {
$httpBackend.flush();
expect(scope.awesomeThings.length).toBe(4);
});
});
|
Revision |
Author |
Commited |
Message |
a2ecfb ...
|
PTKDev |
Fri 20 Nov, 2015 11:22:35 +0000 |
|