diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-13 04:43:37 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-13 04:43:37 +0200 |
commit | 1cb7d9ad1f47c4fce59dad43cc88568524ebc974 (patch) | |
tree | 72fba09f2a9a3ec062238b72b64adca96c3a411b /js/tests/unit/controller/NavigationControllerSpec.js | |
parent | 5f43cd596f95fb1606d51d64b511a12f14e5c064 (diff) |
also delete feeds when their parent folder is being deleted
Diffstat (limited to 'js/tests/unit/controller/NavigationControllerSpec.js')
-rw-r--r-- | js/tests/unit/controller/NavigationControllerSpec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js index bab770e29..8fcc1a94c 100644 --- a/js/tests/unit/controller/NavigationControllerSpec.js +++ b/js/tests/unit/controller/NavigationControllerSpec.js @@ -771,9 +771,11 @@ describe('NavigationController', function () { it('should reversibly delete a folder', inject(function ( $controller, FolderResource, FeedResource) { FolderResource.reversiblyDelete = jasmine.createSpy('reversiblyDelete'); + FeedResource.reversiblyDelete = jasmine.createSpy('reversiblyDelete'); var ctrl = $controller('NavigationController', { FolderResource: FolderResource, + FeedResource: FeedResource }); var folder = { @@ -785,6 +787,8 @@ describe('NavigationController', function () { ctrl.reversiblyDeleteFolder(folder); expect(FolderResource.reversiblyDelete).toHaveBeenCalledWith(3); + expect(FeedResource.reversiblyDelete).toHaveBeenCalledWith(1); + expect(FeedResource.reversiblyDelete).toHaveBeenCalledWith(3); expect(folder.deleted).toBe(true); expect(FeedResource.size(2)).toBe(1); expect(ctrl._deletedFeedsBackup.test.length).toBe(2); @@ -794,6 +798,7 @@ describe('NavigationController', function () { it('should undo delete a folder', inject(function ( $controller, FolderResource, FeedResource) { FolderResource.undoDelete = jasmine.createSpy('undoDelete'); + FeedResource.undoDelete = jasmine.createSpy('undoDelete'); var ctrl = $controller('NavigationController', { FolderResource: FolderResource, @@ -815,8 +820,13 @@ describe('NavigationController', function () { ctrl.undoDeleteFolder(folder); expect(FolderResource.undoDelete).toHaveBeenCalledWith(3); + expect(FeedResource.undoDelete).toHaveBeenCalledWith(1); + expect(FeedResource.undoDelete).toHaveBeenCalledWith(3); expect(folder.deleted).toBe(false); + expect(feed1.deleted).toBe(false); + expect(feed2.deleted).toBe(false); expect(FeedResource.size()).toBe(3); + expect(ctrl._deletedFeedsBackup.test).toBe(undefined); })); |