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/docsSearchSpec.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/docsSearchSpec.js')
| -rw-r--r-- | docs/component-spec/docsSearchSpec.js | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/docs/component-spec/docsSearchSpec.js b/docs/component-spec/docsSearchSpec.js deleted file mode 100644 index f5f8d36e..00000000 --- a/docs/component-spec/docsSearchSpec.js +++ /dev/null @@ -1,53 +0,0 @@ -describe("docsSearch", function() { - - beforeEach(module('docsApp')); - - var interceptedLunrResults; - beforeEach(function() { - interceptedLunrResults = []; - }); - - beforeEach(function() { - module(function($provide) { - var results = []; - results[0] = { section: 'tutorial', shortName: 'item one', keywords: 'item, one, 1' }; - results[1] = { section: 'tutorial', shortName: 'item man', keywords: 'item, man' }; - results[2] = { section: 'api', shortName: 'item other', keywords: 'item, other' }; - results[3] = { section: 'api', shortName: 'ngRepeat', keywords: 'item, other' }; - - $provide.value('NG_PAGES', results); - $provide.factory('lunrSearch', function() { - return function() { - return { - store : function(value) { - interceptedLunrResults.push(value); - }, - search : function(q) { - var data = []; - angular.forEach(results, function(res, i) { - data.push({ ref : i }); - }); - return data; - } - } - }; - }); - }); - }); - - it("should lookup and organize values properly", inject(function(docsSearch) { - var items = docsSearch('item'); - expect(items['api'].length).toBe(2); - })); - - it("should return all results without a search", inject(function(docsSearch) { - var items = docsSearch(); - expect(items['tutorial'].length).toBe(2); - expect(items['api'].length).toBe(2); - })); - - it("should store values with and without a ng prefix", inject(function(docsSearch) { - expect(interceptedLunrResults[3].title).toBe('ngRepeat repeat'); - })); - -}); |
