diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-19 15:54:32 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-19 15:54:32 +0100 |
commit | 676b8dd18742875ae07827792ed88d2b5bb3afb7 (patch) | |
tree | cd4368012b40ff6fa28cefb85e7ab49c729041ca /js/tests/unit/controller/ContentControllerSpec.js | |
parent | 62b6bd485009b5dbb85b50e634ea94aa177d8d42 (diff) |
first stab at recommended sites
Diffstat (limited to 'js/tests/unit/controller/ContentControllerSpec.js')
-rw-r--r-- | js/tests/unit/controller/ContentControllerSpec.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/js/tests/unit/controller/ContentControllerSpec.js b/js/tests/unit/controller/ContentControllerSpec.js index f9a911129..f279906fc 100644 --- a/js/tests/unit/controller/ContentControllerSpec.js +++ b/js/tests/unit/controller/ContentControllerSpec.js @@ -481,4 +481,47 @@ describe('ContentController', function () { })); + + it('should redirect to the explore page if there are no feeds and folders', + inject(function ($controller) { + var location = { + path: jasmine.createSpy('reload') + }; + $controller('ContentController', { + data: {}, + $location: location + }); + + expect(location.path).toHaveBeenCalledWith('/explore'); + })); + + it('should not redirect to the explore page if there are feeds and folders', + inject(function ($controller, FolderResource, FeedResource) { + + FolderResource.add({id: 3, name: 'test'}); + + var location = { + path: jasmine.createSpy('reload') + }; + $controller('ContentController', { + data: {}, + $location: location + }); + + expect(location.path).not.toHaveBeenCalledWith('/explore'); + + FolderResource.clear({id: 3, name: 'test'}); + FeedResource.add({id: 3, url: 'test'}); + + location = { + path: jasmine.createSpy('reload') + }; + $controller('ContentController', { + data: {}, + $location: location + }); + + expect(location.path).not.toHaveBeenCalledWith('/explore'); + })); + }); |