--- /dev/null
+'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);
+ });
+});