diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-04 19:58:51 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-04 19:59:06 +0200 |
commit | 346346e01c5c61e61b522520248de90e0ede3f17 (patch) | |
tree | 9d38239274db7e26eac9eda9f1853113e655857b /js/tests/services/bl/itemblSpec.coffee | |
parent | 2d8b635796ba117619063792b0a00c50dc91d2a6 (diff) |
added most of the bl functionality
Diffstat (limited to 'js/tests/services/bl/itemblSpec.coffee')
-rw-r--r-- | js/tests/services/bl/itemblSpec.coffee | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/js/tests/services/bl/itemblSpec.coffee b/js/tests/services/bl/itemblSpec.coffee index e2644989e..158b09467 100644 --- a/js/tests/services/bl/itemblSpec.coffee +++ b/js/tests/services/bl/itemblSpec.coffee @@ -28,22 +28,9 @@ describe 'ItemBl', -> beforeEach => angular.module('News').factory 'Persistence', => - @persistence = {} + @setFeedReadSpy = jasmine.createSpy('setFeedRead') + @persistence = { + + } beforeEach inject (@ItemModel, @ItemBl, @StatusFlag) => - - - it 'should mark all items read of a feed', => - @persistence.setFeedRead = jasmine.createSpy('setFeedRead') - item1 = {id: 6, feedId: 5, guidHash: 'a1', status: @StatusFlag.UNREAD} - item2 = {id: 3, feedId: 5, guidHash: 'a2', status: @StatusFlag.UNREAD} - item3 = {id: 2, feedId: 5, guidHash: 'a3', status: @StatusFlag.UNREAD} - @ItemModel.add(item1) - @ItemModel.add(item2) - @ItemModel.add(item3) - @ItemBl.markAllRead(5) - - expect(@persistence.setFeedRead).toHaveBeenCalledWith(5, 6) - expect(item1.isRead()).toBe(true) - expect(item2.isRead()).toBe(true) - expect(item3.isRead()).toBe(true)
\ No newline at end of file |