From 53679811da855acf9bd944a389a48399ca5d5a15 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 10 Aug 2015 20:20:30 +0200 Subject: serverside full text remove enhancers add full text client side implementation fix bugs and tests for full text feed --- .../unit/controller/NavigationControllerSpec.js | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'js/tests/unit/controller/NavigationControllerSpec.js') 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') -- cgit v1.2.3