diff options
| author | Peter Bacon Darwin | 2014-02-12 22:47:42 +0000 |
|---|---|---|
| committer | Peter Bacon Darwin | 2014-02-16 19:03:41 +0000 |
| commit | 389d4879da4aa620ee95d789b19ff9be44eb730a (patch) | |
| tree | 93352ddc8738a975904a1774d51b93d585ca1075 /docs/component-spec/NavigationCtrlSpec.js | |
| parent | a564160511bf1bbed5a4fe5d2981fae1bb664eca (diff) | |
| download | angular.js-389d4879da4aa620ee95d789b19ff9be44eb730a.tar.bz2 | |
chore(doc-gen): new docs
chore(doc-gen): implement dgeni
Diffstat (limited to 'docs/component-spec/NavigationCtrlSpec.js')
| -rw-r--r-- | docs/component-spec/NavigationCtrlSpec.js | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/docs/component-spec/NavigationCtrlSpec.js b/docs/component-spec/NavigationCtrlSpec.js deleted file mode 100644 index d7a9da45..00000000 --- a/docs/component-spec/NavigationCtrlSpec.js +++ /dev/null @@ -1,72 +0,0 @@ -describe("DocsNavigationCtrl", function() { - - beforeEach(module('docsApp')); - - var ctrl, $scope; - - beforeEach(function() { - module(function($provide) { - $provide.value('docsPages', []); - $provide.factory('docsSearch', function() { - return function(q) { - return ['one','two','three']; - }; - }); - }); - inject(function($controller, $rootScope, $location, docsSearch) { - $scope = $rootScope.$new(); - ctrl = $controller('DocsNavigationCtrl', { - $scope : $scope, - $location : $location, - docsSearch : docsSearch - }); - }); - }); - - it("should search and return data from docsSearch", function() { - $scope.search('1234') - expect($scope.results.join(',')).toBe('one,two,three'); - expect($scope.hasResults).toBe(true); - }); - - it("should avoid searching if the search term is too short", function() { - $scope.search('1') - expect($scope.results.length).toBe(0); - expect($scope.hasResults).toBe(false); - }); - - it("should set the columns classname based on the total grouped results", function() { - $scope.search('1234'); - expect($scope.colClassName).toBe('cols-3'); - - $scope.search('1'); - expect($scope.colClassName).toBe(null); - }); - - it("should hide and clear the results when called", function() { - $scope.hasResults = true; - $scope.results = ['one']; - $scope.colClassName = '...'; - $scope.hideResults(); - expect($scope.hasResults).toBe(false); - expect($scope.results.length).toBe(0); - expect($scope.colClassName).toBe(null); - }); - - it("should hide, clear and change the path of the page when submitted", inject(function($location) { - $scope.hasResults = true; - $scope.results = { - api : [ - {url : '/home'} - ], - tutorial : [ - {url : '/tutorial'} - ] - }; - $scope.submit(); - expect($location.path()).toBe('/home'); - expect($scope.results.length).toBe(0); - expect($scope.hasResults).toBe(false); - })); - -}); |
