summaryrefslogtreecommitdiffstats
path: root/js/tests/unit/controller/NavigationControllerSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/controller/NavigationControllerSpec.js')
-rw-r--r--js/tests/unit/controller/NavigationControllerSpec.js38
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')