Skip to content

Commit

Permalink
Merge pull request #138 from ably/fix-history-pagination-test
Browse files Browse the repository at this point in the history
Improve pagination history test
  • Loading branch information
funkyboy authored Apr 20, 2018
2 parents 8a7fece + eb729e1 commit 07aabcf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spec/acceptance/rest/channel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,13 @@

# Page 3
expect(page_3.items.size).to eql(1)
expect(page_3).to be_last
# This test should be deterministic but it's not.
# Sometimes the backend, to avoid too much work, returns a `next` link that contains empty reults.
if page_3.next
expect(page_3.next.items.length).to eql(0)
else
expect(page_3).to be_last
end
end

context 'direction' do
Expand Down

0 comments on commit 07aabcf

Please sign in to comment.