summaryrefslogtreecommitdiffstats
path: root/js/tests/services/bl/itemblSpec.coffee
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-04 15:23:58 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-04 15:23:58 +0200
commitb723c12e4c3e0039d9785861d4ad204fd899ac52 (patch)
treee7adc950dd113d3efffdca25c0bc77278edebb0d /js/tests/services/bl/itemblSpec.coffee
parent180b36f9b234e68c9ab314d67b23f13548790c6c (diff)
improved and cleaned up js unittests
Diffstat (limited to 'js/tests/services/bl/itemblSpec.coffee')
-rw-r--r--js/tests/services/bl/itemblSpec.coffee13
1 files changed, 7 insertions, 6 deletions
diff --git a/js/tests/services/bl/itemblSpec.coffee b/js/tests/services/bl/itemblSpec.coffee
index f46b178ac..36a283de2 100644
--- a/js/tests/services/bl/itemblSpec.coffee
+++ b/js/tests/services/bl/itemblSpec.coffee
@@ -21,16 +21,17 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
###
-describe '_ItemBl', ->
+describe 'ItemBl', ->
beforeEach module 'News'
- beforeEach inject (@ItemModel, @_ItemBl, @StatusFlag) =>
- @persistence =
- getItems: ->
+ beforeEach =>
+ angular.module('News').factory 'Persistence', =>
+ @persistence =
+ getItems: ->
- @bl = new _ItemBl(@ItemModel, @persistence)
+ beforeEach inject (@ItemModel, @ItemBl, @StatusFlag) =>
it 'should mark all items read of a feed', =>
@@ -41,7 +42,7 @@ describe '_ItemBl', ->
@ItemModel.add(item1)
@ItemModel.add(item2)
@ItemModel.add(item3)
- @bl.markAllRead(5)
+ @ItemBl.markAllRead(5)
expect(@persistence.setFeedRead).toHaveBeenCalledWith(5, 6)
expect(item1.isRead()).toBe(true)