diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-05 11:38:12 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-05 11:38:12 +0200 |
commit | 54a67849bd6fe0608c9940bfa1b87b24c07ba41e (patch) | |
tree | feda2c2843402019808d6da4d6a4d77666394d47 /js/tests/services/bl/feedblSpec.coffee | |
parent | f8451ca565c07cfe42d5cf5a9d3d02cba4f2d773 (diff) |
brought back feeds and folders
Diffstat (limited to 'js/tests/services/bl/feedblSpec.coffee')
-rw-r--r-- | js/tests/services/bl/feedblSpec.coffee | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/js/tests/services/bl/feedblSpec.coffee b/js/tests/services/bl/feedblSpec.coffee index 8cd8100a3..798fd2e6f 100644 --- a/js/tests/services/bl/feedblSpec.coffee +++ b/js/tests/services/bl/feedblSpec.coffee @@ -28,8 +28,10 @@ describe 'FeedBl', -> beforeEach => angular.module('News').factory 'Persistence', => @setFeedReadSpy = jasmine.createSpy('setFeedRead') + @getItemsSpy = jasmine.createSpy('Get Items') @persistence = { setFeedRead: @setFeedReadSpy + getItems: @getItemsSpy } beforeEach inject (@FeedBl, @FeedModel, @ItemModel, @FeedType, @@ -185,4 +187,27 @@ describe 'FeedBl', -> expect(@FeedBl.isShowAll()).toBe(false) @FeedBl.setShowAll(true) - expect(@FeedBl.isShowAll()).toBe(true)
\ No newline at end of file + expect(@FeedBl.isShowAll()).toBe(true) + + + it 'should reload the active feed if showall changed', => + @persistence.userSettingsReadShow = jasmine.createSpy('Show All') + @persistence.userSettingsReadHide = jasmine.createSpy('Hide All') + + @FeedBl.setShowAll(true) + + expect(@getItemsSpy).toHaveBeenCalledWith(@FeedType.Folder, 0, 0) + + + it 'should return all feeds of a folder', => + item1 = {id: 2, unreadCount:134, urlHash: 'a1', folderId: 3} + item2 = {id: 4, unreadCount:134, urlHash: 'a2', folderId: 2} + item3 = {id: 5, unreadCount:134, urlHash: 'a3', folderId: 3} + @FeedModel.add(item1) + @FeedModel.add(item2) + @FeedModel.add(item3) + + folders = @FeedBl.getFeedsOfFolder(3) + + expect(folders).toContain(item1) + expect(folders).toContain(item3)
\ No newline at end of file |