diff options
Diffstat (limited to 'js/tests/unit/controller/NavigationControllerSpec.js')
-rw-r--r-- | js/tests/unit/controller/NavigationControllerSpec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js index 7a991762e..411c43ef2 100644 --- a/js/tests/unit/controller/NavigationControllerSpec.js +++ b/js/tests/unit/controller/NavigationControllerSpec.js @@ -595,4 +595,24 @@ describe('NavigationController', function () { })); + it('should rename a feed', inject( + function ($controller, FEED_TYPE, FeedResource) { + FeedResource.rename = jasmine.createSpy('rename'); + + var ctrl = $controller('NavigationController', { + FeedResource: FeedResource, + }); + + var feed = { + id: 3, + title: 'test', + editing: true + }; + + ctrl.renameFeed(feed); + + expect(FeedResource.rename).toHaveBeenCalledWith(3, 'test'); + expect(feed.editing).toBe(false); + })); + }); |