diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-20 17:16:27 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-20 17:16:27 +0100 |
commit | 1246c296cb432af47ecb1baacb8faa3c93fc9118 (patch) | |
tree | a30778a868765a52a3f419ef64ffbcd1f5dd8ba9 /js/tests/unit/controller | |
parent | 5cc1be3a0183c52064a087e2f9514422982a28a1 (diff) |
hide suggestions from explore if they are already in your feed list
Diffstat (limited to 'js/tests/unit/controller')
-rw-r--r-- | js/tests/unit/controller/ExploreControllerSpec.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/js/tests/unit/controller/ExploreControllerSpec.js b/js/tests/unit/controller/ExploreControllerSpec.js index cc75db409..a323e8d65 100644 --- a/js/tests/unit/controller/ExploreControllerSpec.js +++ b/js/tests/unit/controller/ExploreControllerSpec.js @@ -14,7 +14,18 @@ describe('ExploreController', function () { scope, sites; - beforeEach(module('News')); + beforeEach(module('News', function ($provide) { + $provide.constant('BASE_URL', 'base'); + $provide.constant('ITEM_BATCH_SIZE', 5); + $provide.constant('ITEM_AUTO_PAGE_SIZE', 1); + $provide.constant('FEED_TYPE', { + FEED: 0, + FOLDER: 1, + STARRED: 2, + SUBSCRIPTIONS: 3, + SHARED: 4 + }); + })); beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); @@ -41,4 +52,12 @@ describe('ExploreController', function () { expect(scope.$broadcast).toHaveBeenCalledWith('addFeed', 'test'); })); + + it('should check if a feed is available sites', inject( + function (FeedResource) { + FeedResource.add({id: 3, url: 'test'}); + expect(controller.feedExists('test')).toBe(true); + expect(controller.feedExists('amen')).toBe(false); + })); + });
\ No newline at end of file |