summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-09-06 15:42:51 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2015-09-06 15:42:51 +0200
commit70ff47a9b77797e75137ba02f0b7df9bc2745f56 (patch)
treeaef60c640494dc3996ae565ce6f4b74cc2dee572 /js/tests
parent5323fa1fb1bd43ef653a91f5bba6d63cd18078f3 (diff)
fix # 848
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/controller/NavigationControllerSpec.js21
-rw-r--r--js/tests/unit/service/FeedResourceSpec.js14
2 files changed, 34 insertions, 1 deletions
diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js
index 78d2fc914..53d2e139f 100644
--- a/js/tests/unit/controller/NavigationControllerSpec.js
+++ b/js/tests/unit/controller/NavigationControllerSpec.js
@@ -1038,6 +1038,27 @@ describe('NavigationController', function () {
}));
+ it ('should set the feed pinning',
+ inject(function ($controller, FeedResource) {
+
+ FeedResource.add({
+ id: 2,
+ url: 'http://test.com',
+ folderId: 3,
+ ordering: 0,
+ pinned: false
+ });
+
+ FeedResource.setPinned = jasmine.createSpy('pinned');
+
+ var ctrl = $controller('NavigationController');
+
+ ctrl.togglePinned(2);
+
+ expect(FeedResource.setPinned).toHaveBeenCalledWith(2, true);
+ }));
+
+
it ('should set the full text feed',
inject(function ($controller, FeedResource, $rootScope) {
diff --git a/js/tests/unit/service/FeedResourceSpec.js b/js/tests/unit/service/FeedResourceSpec.js
index 15c237929..5c900de3f 100644
--- a/js/tests/unit/service/FeedResourceSpec.js
+++ b/js/tests/unit/service/FeedResourceSpec.js
@@ -302,6 +302,19 @@ describe('FeedResource', function () {
}));
+ it ('should set the feed pinning', inject(function (FeedResource) {
+ http.expectPOST('base/feeds/3/pinned', {
+ isPinned: true
+ }).respond(200, {});
+
+ FeedResource.setPinned(3, true);
+
+ http.flush();
+
+ expect(FeedResource.getById(3).pinned).toBe(true);
+ }));
+
+
it ('should toggle full text', inject(function (FeedResource) {
http.expectPOST('base/feeds/3/fulltext', {
fullTextEnabled: true
@@ -312,7 +325,6 @@ describe('FeedResource', function () {
expect(FeedResource.getById(3).fullTextEnabled).toBe(true);
http.flush();
-
}));
});