diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-08-10 20:20:30 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-08-12 17:05:18 +0200 |
commit | 53679811da855acf9bd944a389a48399ca5d5a15 (patch) | |
tree | fa75e06a965fb5751017288a5c135bc179574210 /js/tests/unit/controller | |
parent | c77a6705d34c81cb933f3d4b83eb18e2b586035a (diff) |
serverside full text
remove enhancers
add full text client side implementation
fix bugs and tests for full text feed
Diffstat (limited to 'js/tests/unit/controller')
-rw-r--r-- | js/tests/unit/controller/NavigationControllerSpec.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js index d6b016c9a..78d2fc914 100644 --- a/js/tests/unit/controller/NavigationControllerSpec.js +++ b/js/tests/unit/controller/NavigationControllerSpec.js @@ -1038,6 +1038,44 @@ describe('NavigationController', function () { })); + it ('should set the full text feed', + inject(function ($controller, FeedResource, $rootScope) { + + FeedResource.add({ + id: 2, + url: 'http://test.com', + folderId: 3, + fullTextEnabled: false + }); + + $rootScope.$broadcast = jasmine.createSpy('broadcast'); + + FeedResource.toggleFullText = jasmine.createSpy('ordering'); + FeedResource.toggleFullText.and.callFake(function () { + return { + finally: function (cb) { + cb(); + } + }; + }); + + var route = { + reload: jasmine.createSpy('reload') + }; + var ctrl = $controller('NavigationController', { + $route: route + }); + + ctrl.toggleFullText(FeedResource.getById(2)); + + expect($rootScope.$broadcast).toHaveBeenCalledWith('$routeChangeStart'); + expect($rootScope.$broadcast). + toHaveBeenCalledWith('$routeChangeSuccess'); + expect(FeedResource.toggleFullText).toHaveBeenCalledWith(2); + expect(route.reload).toHaveBeenCalled(); + })); + + it ('should set location on search', inject(function ($controller) { var location = { search: jasmine.createSpy('search') |