diff options
Diffstat (limited to 'js/tests/unit')
-rw-r--r-- | js/tests/unit/controller/ExploreControllerSpec.js | 8 | ||||
-rw-r--r-- | js/tests/unit/service/FeedResourceSpec.js | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/js/tests/unit/controller/ExploreControllerSpec.js b/js/tests/unit/controller/ExploreControllerSpec.js index 977ab5c32..0df9dc82b 100644 --- a/js/tests/unit/controller/ExploreControllerSpec.js +++ b/js/tests/unit/controller/ExploreControllerSpec.js @@ -55,7 +55,7 @@ describe('ExploreController', function () { it('should check if a feed is available sites', inject( function (FeedResource) { - FeedResource.add({id: 3, url: 'test'}); + FeedResource.add({id: 3, location: 'test', url: 'a'}); expect(controller.feedExists('test')).toBe(true); expect(controller.feedExists('amen')).toBe(false); })); @@ -63,10 +63,10 @@ describe('ExploreController', function () { it('should hide categories without unadded sites', inject( function (FeedResource) { - FeedResource.add({id: 3, url: 'test'}); + FeedResource.add({id: 3, location: 'test', url: 'a'}); - var data1 = [{url: 'test'}, {url: 'test2'}]; - var data2 = [{url: 'test'}]; + var data1 = [{feed: 'test'}, {feed: 'test2'}]; + var data2 = [{feed: 'test'}]; expect(controller.isCategoryShown(data1)).toBe(true); expect(controller.isCategoryShown(data2)).toBe(false); diff --git a/js/tests/unit/service/FeedResourceSpec.js b/js/tests/unit/service/FeedResourceSpec.js index 6732016e6..3bad50f4f 100644 --- a/js/tests/unit/service/FeedResourceSpec.js +++ b/js/tests/unit/service/FeedResourceSpec.js @@ -27,8 +27,8 @@ describe('FeedResource', function () { resource = FeedResource; http = $httpBackend; FeedResource.receive([ - {id: 1, folderId: 3, url: 'ye', unreadCount: 45}, - {id: 2, folderId: 4, url: 'sye', unreadCount: 25}, + {id: 1, folderId: 3, url: 'ye', unreadCount: 45}, + {id: 2, folderId: 4, location: 'test', url: 'sye', unreadCount: 25}, {id: 3, folderId: 3, title: 'hore', url: '1sye', unreadCount: 0} ]); })); @@ -121,6 +121,7 @@ describe('FeedResource', function () { http.flush(); expect(FeedResource.getById(2).deleted).toBe(true); + expect(FeedResource.getByLocation('test').deleted).toBe(true); expect(FeedResource.getUnreadCount()).toBe(70); })); |