0
0
Fork 0

Support min_id-based pagination for bookmarks (#12381)

* Support min_id-based pagination for bookmarks

* Fix spec
This commit is contained in:
Gomasy 2019-11-18 01:09:42 +09:00 committed by Eugen Rochko
parent df15a2cd37
commit 5a2c0707f1
2 changed files with 4 additions and 5 deletions

View file

@ -64,7 +64,7 @@ RSpec.describe Api::V1::BookmarksController, type: :controller do
get :index, params: { limit: 1 }
expect(response.headers['Link'].find_link(['rel', 'next']).href).to eq "http://test.host/api/v1/bookmarks?limit=1&max_id=#{bookmark.id}"
expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq "http://test.host/api/v1/bookmarks?limit=1&since_id=#{bookmark.id}"
expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq "http://test.host/api/v1/bookmarks?limit=1&min_id=#{bookmark.id}"
end
it 'does not add pagination headers if not necessary' do