gaf-mobile
Version:
GAF mobile Web site
37 lines (28 loc) • 847 B
JavaScript
'use strict';
describe('Controller: ErrorCtrl', function() {
// Vars
var $scope, $location, createCtrl;
// Load the controller's module
beforeEach(module('gafMobileApp'));
// Initialize the controller
beforeEach(inject(function($controller, _$rootScope_, _$location_) {
$scope = _$rootScope_.$new();
$location = _$location_;
// Mock window to prevent full page reload
var fakeWindow = { location: { href: '' } };
// Controller constructer to enable to tweak the
// mock ups before instantiate it
createCtrl = function() {
return $controller('ErrorCtrl', {
$scope: $scope,
$location: _$location_,
$window: fakeWindow
});
};
}));
it('should redirect user back to homepage',
function() {
createCtrl();
expect($location.path()).toBe('/');
});
});