From b250747c6681dca656b0761f70f53d0295d228d1 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sun, 1 Nov 2015 14:25:05 +0100 Subject: fix #882 --- .../unit/controller/NavigationControllerSpec.js | 30 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) (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 53d2e139f..a5300453f 100644 --- a/js/tests/unit/controller/NavigationControllerSpec.js +++ b/js/tests/unit/controller/NavigationControllerSpec.js @@ -1022,7 +1022,7 @@ describe('NavigationController', function () { ordering: 0 }); - FeedResource.setOrdering = jasmine.createSpy('ordering'); + FeedResource.patch = jasmine.createSpy('patch'); var route = { reload: jasmine.createSpy('reload') @@ -1033,7 +1033,7 @@ describe('NavigationController', function () { ctrl.setOrdering(FeedResource.getById(2), 2); - expect(FeedResource.setOrdering).toHaveBeenCalledWith(2, 2); + expect(FeedResource.patch).toHaveBeenCalledWith(2, {ordering:2}); expect(route.reload).toHaveBeenCalled(); })); @@ -1049,13 +1049,13 @@ describe('NavigationController', function () { pinned: false }); - FeedResource.setPinned = jasmine.createSpy('pinned'); + FeedResource.patch = jasmine.createSpy('patch'); var ctrl = $controller('NavigationController'); ctrl.togglePinned(2); - expect(FeedResource.setPinned).toHaveBeenCalledWith(2, true); + expect(FeedResource.patch).toHaveBeenCalledWith(2, {pinned: true}); })); @@ -1097,6 +1097,28 @@ describe('NavigationController', function () { })); + it ('should toggle updateModes', + inject(function ($controller, FeedResource) { + + FeedResource.add({ + id: 2, + url: 'http://test.com', + folderId: 3, + ordering: 0, + pinned: false, + updateMode: 1 + }); + + FeedResource.patch = jasmine.createSpy('patch'); + + var ctrl = $controller('NavigationController'); + + ctrl.setUpdateMode(2, 0); + + expect(FeedResource.patch).toHaveBeenCalledWith(2, {updateMode: 0}); + })); + + it ('should set location on search', inject(function ($controller) { var location = { search: jasmine.createSpy('search') -- cgit v1.2.3