diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-25 21:13:09 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-25 21:13:09 +0100 |
commit | 7ade1165ddd0aa2d650ea28ae2f38a412375f9cc (patch) | |
tree | d2afa45ede7e721e2e0c0efdc0106bc3e049db17 /js/tests/services | |
parent | 29b4fc15528cd88ab1b7b77aa7b9b4632042dd0c (diff) |
added feedcontroller methods and tests
Diffstat (limited to 'js/tests/services')
-rw-r--r-- | js/tests/services/showallSpec.coffee | 17 | ||||
-rw-r--r-- | js/tests/services/starredcountSpec.coffee | 15 |
2 files changed, 20 insertions, 12 deletions
diff --git a/js/tests/services/showallSpec.coffee b/js/tests/services/showallSpec.coffee index 65c163ccf..7eba354f4 100644 --- a/js/tests/services/showallSpec.coffee +++ b/js/tests/services/showallSpec.coffee @@ -27,16 +27,23 @@ describe '_ShowAll', -> beforeEach module 'News' beforeEach inject (@_ShowAll) => + @showAll = new @_ShowAll() it 'should be false by default', => - showAll = new @_ShowAll() + - expect(showAll.getShowAll()).toBeFalsy() + expect(@showAll.getShowAll()).toBeFalsy() it 'should set the correct showAll value', => - showAll = new @_ShowAll() - showAll.handle(true) + @showAll.handle(true) + expect(@showAll.getShowAll()).toBeTruthy() - expect(showAll.getShowAll()).toBeTruthy()
\ No newline at end of file + + it 'should provide a set showall setter', => + @showAll.setShowAll(true) + expect(@showAll.getShowAll()).toBeTruthy() + + @showAll.setShowAll(false) + expect(@showAll.getShowAll()).toBeFalsy() diff --git a/js/tests/services/starredcountSpec.coffee b/js/tests/services/starredcountSpec.coffee index f7b619a95..61598324a 100644 --- a/js/tests/services/starredcountSpec.coffee +++ b/js/tests/services/starredcountSpec.coffee @@ -27,16 +27,17 @@ describe '_StarredCount', -> beforeEach module 'News' beforeEach inject (@_StarredCount) => - + @starred = new @_StarredCount() it 'should be 0 by default', => - starred = new @_StarredCount() - - expect(starred.getStarredCount()).toBe(0) + expect(@starred.getStarredCount()).toBe(0) it 'should set the correct starred count', => - starred = new @_StarredCount() - starred.handle(3) + @starred.handle(3) + expect(@starred.getStarredCount()).toBe(3) + - expect(starred.getStarredCount()).toBe(3)
\ No newline at end of file + it 'should provide a setter', => + @starred.setStarredCount(15) + expect(@starred.getStarredCount()).toBe(15)
\ No newline at end of file |