Skip to content

Instantly share code, notes, and snippets.

@zdwolfe
Created October 30, 2013 14:15
Show Gist options
  • Save zdwolfe/7233395 to your computer and use it in GitHub Desktop.
Save zdwolfe/7233395 to your computer and use it in GitHub Desktop.
'use strict';
describe('Controller: CourseCtrl', function () {
// load the controller's module
beforeEach(module('myApp'));
// load controller widgets/views/partials
var views = [
'views/course.html',
'views/main.html'
];
views.forEach(function(view) {
beforeEach(module(view));
});
var CourseCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
CourseCtrl = $controller('CourseCtrl', {
$scope: scope
});
}));
it('should should transition to main.course', inject(function ($state, $rootScope) {
$state.transitionTo('main.course');
$rootScope.$apply();
expect($state.current.name).toBe('main.course');
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment