summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
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();
-
}));
});