diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-09-28 02:23:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-28 02:23:45 +0200 |
commit | f0fff3eb1051ff77ec3f37aa75f8c56720b626a3 (patch) | |
tree | 7033a49d339bf8ff7ee4c96eb2d27ad40c9f4680 /spec/controllers/api | |
parent | 3d7f68c273f03497ff555acac70355ba1815f7a2 (diff) |
Support min_id-based pagination in REST API (#8736)
* Allow min_id pagination in Feed#get * Add min_id pagination to home and list timeline APIs * Add min_id pagination to account statuses, public and tag APIs * Remove unused stub in reports API * Use min_id pagination in notifications, favourites, and fix order * Fix HomeFeed#from_database not using paginate_by_id
Diffstat (limited to 'spec/controllers/api')
-rw-r--r-- | spec/controllers/api/v1/favourites_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/api/v1/reports_controller_spec.rb | 10 |
2 files changed, 1 insertions, 11 deletions
diff --git a/spec/controllers/api/v1/favourites_controller_spec.rb b/spec/controllers/api/v1/favourites_controller_spec.rb index 2bdf927f2..231f76500 100644 --- a/spec/controllers/api/v1/favourites_controller_spec.rb +++ b/spec/controllers/api/v1/favourites_controller_spec.rb @@ -64,7 +64,7 @@ RSpec.describe Api::V1::FavouritesController, type: :controller do get :index, params: { limit: 1 } expect(response.headers['Link'].find_link(['rel', 'next']).href).to eq "http://test.host/api/v1/favourites?limit=1&max_id=#{favourite.id}" - expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq "http://test.host/api/v1/favourites?limit=1&since_id=#{favourite.id}" + expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq "http://test.host/api/v1/favourites?limit=1&min_id=#{favourite.id}" end it 'does not add pagination headers if not necessary' do diff --git a/spec/controllers/api/v1/reports_controller_spec.rb b/spec/controllers/api/v1/reports_controller_spec.rb index ac93998c6..a3596cf8a 100644 --- a/spec/controllers/api/v1/reports_controller_spec.rb +++ b/spec/controllers/api/v1/reports_controller_spec.rb @@ -12,16 +12,6 @@ RSpec.describe Api::V1::ReportsController, type: :controller do allow(controller).to receive(:doorkeeper_token) { token } end - describe 'GET #index' do - let(:scopes) { 'read:reports' } - - it 'returns http success' do - get :index - - expect(response).to have_http_status(200) - end - end - describe 'POST #create' do let(:scopes) { 'write:reports' } let!(:status) { Fabricate(:status) } |