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