summaryrefslogtreecommitdiffstats
path: root/js/tests/controllers/itemcontrollerSpec.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/controllers/itemcontrollerSpec.coffee')
-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()