summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-22 02:15:56 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-22 02:15:56 +0200
commit2b4da592f1c8a2210f9ba49a9e24eb2056e5d4a8 (patch)
treea75d63fcfbe307bd22bef14f8befaa9545c8f544 /js/tests
parentf0aae6875bc1da724d1960805f88b4b707742a44 (diff)
simplify star and read
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/controller/AppControllerSpec.js4
-rw-r--r--js/tests/unit/controller/ContentControllerSpec.js4
-rw-r--r--js/tests/unit/service/ItemResourceSpec.js24
-rw-r--r--js/tests/unit/service/ResourceSpec.js2
4 files changed, 30 insertions, 4 deletions
diff --git a/js/tests/unit/controller/AppControllerSpec.js b/js/tests/unit/controller/AppControllerSpec.js
index fc5780a40..772fdc565 100644
--- a/js/tests/unit/controller/AppControllerSpec.js
+++ b/js/tests/unit/controller/AppControllerSpec.js
@@ -12,7 +12,9 @@ describe('AppController', () => {
let controller;
- beforeEach(module('News'));
+ beforeEach(module('News', ($provide) => {
+ $provide.value('BASE_URL', 'base');
+ }));
beforeEach(inject(($controller) => {
controller = $controller('AppController');
diff --git a/js/tests/unit/controller/ContentControllerSpec.js b/js/tests/unit/controller/ContentControllerSpec.js
index 1dbd3d936..422bd21f4 100644
--- a/js/tests/unit/controller/ContentControllerSpec.js
+++ b/js/tests/unit/controller/ContentControllerSpec.js
@@ -10,7 +10,9 @@
describe('ContentController', () => {
'use strict';
- beforeEach(module('News'));
+ beforeEach(module('News', ($provide) => {
+ $provide.value('BASE_URL', 'base');
+ }));
it('should publish data to models', inject(($controller, Publisher,
diff --git a/js/tests/unit/service/ItemResourceSpec.js b/js/tests/unit/service/ItemResourceSpec.js
index acbf0850c..8d0f1864e 100644
--- a/js/tests/unit/service/ItemResourceSpec.js
+++ b/js/tests/unit/service/ItemResourceSpec.js
@@ -10,7 +10,9 @@
describe('ItemResource', () => {
'use strict';
- beforeEach(module('News'));
+ beforeEach(module('News', ($provide) => {
+ $provide.value('BASE_URL', 'base');
+ }));
it('should receive the newestItemId', inject((ItemResource) => {
@@ -40,4 +42,24 @@ describe('ItemResource', () => {
expect(ItemResource.size()).toBe(2);
}));
+
+ it ('should mark item as read', inject((ItemResource) => {
+ ItemResource.receive([
+ {
+ id: 3,
+ feedId: 4,
+ unread: true
+ },
+ {
+ id: 4,
+ feedId: 3,
+ unread: true
+ }
+ ], 'items');
+
+ ItemResource.markRead(3);
+
+ expect(ItemResource.get(3).unread).toBe(false);
+ }));
+
}); \ No newline at end of file
diff --git a/js/tests/unit/service/ResourceSpec.js b/js/tests/unit/service/ResourceSpec.js
index 2fead3479..b1b8ed054 100644
--- a/js/tests/unit/service/ResourceSpec.js
+++ b/js/tests/unit/service/ResourceSpec.js
@@ -17,7 +17,7 @@ describe('Resource', () => {
beforeEach(inject((Resource, $http) => {
class ChildResource extends Resource {
constructor ($http) {
- super($http);
+ super($http, 'base');
}
}