Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('The navigation controller', function() {
- var $scope, $location;
- // I'm not fond of this bit myself tbh (pulling an injected service upwards)
- beforeEach(inject(function($rootScope, $controller) {
- $location = jasmine.createSpyObj('$location', ['path']);
- $scope = $rootScope.$new();
- $controller('NavCtrl', {
- $scope: $scope,
- $location: $location
- });
- }));
- it('should have a method to check if the path is active', function() {
- $location.path.andReturn('/about');
- expect($scope.isActive('/about')).toBe(true);
- expect($scope.isActive('/contact')).toBe(false);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment