summaryrefslogtreecommitdiffstats
path: root/js/tests/controllers
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-29 13:25:04 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-29 13:30:01 +0200
commit3fc18156ae0b586e8de0c82949acfa6291317536 (patch)
tree201e97511bea44c58b5e9d78d8cf36ae2e2b54f9 /js/tests/controllers
parenta03b54c6a59837d0045c140ea7aef3fae95daa95 (diff)
go back to order by id, fix #138, use a newest item id to prevent marking items as read that the user didnt see yet fix #141, also update the starred count periodically
Diffstat (limited to 'js/tests/controllers')
-rw-r--r--js/tests/controllers/itemcontrollerSpec.coffee12
1 files changed, 5 insertions, 7 deletions
diff --git a/js/tests/controllers/itemcontrollerSpec.coffee b/js/tests/controllers/itemcontrollerSpec.coffee
index 3a7e6712a..fe1e85c0b 100644
--- a/js/tests/controllers/itemcontrollerSpec.coffee
+++ b/js/tests/controllers/itemcontrollerSpec.coffee
@@ -101,7 +101,7 @@ describe 'ItemController', ->
expect(@persistence.getItems).not.toHaveBeenCalled()
- it 'should autoPage with the newest Item Id', =>
+ it 'should autoPage with the lowest Item Id', =>
@NewestItem.handle(25)
@persistence.getItems = jasmine.createSpy('getItems')
@@ -116,12 +116,11 @@ describe 'ItemController', ->
@scope.$broadcast 'autoPage'
expect(@persistence.getItems).toHaveBeenCalledWith(
- @FeedType.Folder, 3, 3, 25, jasmine.any(Function)
+ @FeedType.Folder, 3, 3, jasmine.any(Function)
)
it 'should not prevent autopaging if there are no items', =>
- @NewestItem.handle(25)
@scope.$broadcast 'autoPage'
@persistence.getItems = jasmine.createSpy('getItems')
@@ -130,12 +129,11 @@ describe 'ItemController', ->
@scope.$broadcast 'autoPage'
expect(@persistence.getItems).toHaveBeenCalledWith(
- @FeedType.Folder, 3, 1, 25, jasmine.any(Function)
+ @FeedType.Folder, 3, 3, jasmine.any(Function)
)
it 'should not send multiple autopage requests at once', =>
- @NewestItem.handle(25)
@persistence.getItems = jasmine.createSpy('getItems')
item1 = {id: 3, guidHash: 'abcd', feedId: 3}
@ItemModel.add(item1)
@@ -148,14 +146,14 @@ describe 'ItemController', ->
@scope.$broadcast 'autoPage'
expect(@persistence.getItems).not.toHaveBeenCalledWith(
- @FeedType.Folder, 2, 1, 25, jasmine.any(Function)
+ @FeedType.Folder, 2, 3, jasmine.any(Function)
)
it 'should allow another autopaging request if the last one finished', =>
@NewestItem.handle(25)
@persistence.getItems = jasmine.createSpy('getItems')
- @persistence.getItems.andCallFake (type, id, offset, newestItemId,
+ @persistence.getItems.andCallFake (type, id, offset,
onSuccess) ->
onSuccess()