Sha256: a16463df4f7947586299a6601665ca25cdc9c0f3763f082c679a69ea57a2b145

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

describe("Testing Controllers", function() {
    describe('Controller NavCtrl:', function() {
        
        beforeEach(module('robeaux'));
        
        var $scope, $rootScope, $httpBackend, $location, $timeout, testController;
        
        beforeEach(inject(function($injector) {
            $timeout = $injector.get('$timeout');
            $httpBackend = $injector.get('$httpBackend');
            $rootScope = $injector.get('$rootScope');
            $location = $injector.get('$location');
            $scope = $rootScope.$new();

            var $controller = $injector.get('$controller');

            testController = function() {
                return $controller('NavCtrl', {
                    '$scope': $scope
                });
            };

            var controller = testController();
        }));

        afterEach(function() {
            $httpBackend.verifyNoOutstandingExpectation();
            $httpBackend.verifyNoOutstandingRequest();
        });

        describe('active:', function() {
            it('should return if current path is the same as the location path', function() {
                $location.path('robots');
                
                expect($scope.active('robots')).toEqual(true);
                expect($scope.active('robots/myRobot')).toEqual(false);
            });
        });
    });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
robeaux-0.3.0 test/controllers/nav_ctrl.js