summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-11-21 13:53:36 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-11-21 13:53:47 +0100
commit8ddead06277f7c863fe048e9990d4c9ce0c24424 (patch)
tree699416065dcf10871bf416164f36f1d05a03a480 /js/tests
parent3306d28e2d45fa03c2ca5b93de45ad59e7aad3f0 (diff)
fix #660
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/controller/ExploreControllerSpec.js8
-rw-r--r--js/tests/unit/service/FeedResourceSpec.js5
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);
}));