0
0
Fork 0

DB speedup in API:: controller/request specs (#25516)

This commit is contained in:
Matt Jankowski 2023-10-13 08:42:09 -04:00 committed by GitHub
parent ecdb31d479
commit fd9dea21d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 181 additions and 746 deletions

View file

@ -14,15 +14,10 @@ describe Api::V1::Accounts::StatusesController do
end
describe 'GET #index' do
it 'returns http success' do
it 'returns expected headers', :aggregate_failures do
get :index, params: { account_id: user.account.id, limit: 1 }
expect(response).to have_http_status(200)
end
it 'returns expected headers' do
get :index, params: { account_id: user.account.id, limit: 1 }
expect(response.headers['Link'].links.size).to eq(2)
end
@ -44,14 +39,11 @@ describe Api::V1::Accounts::StatusesController do
get :index, params: { account_id: user.account.id, exclude_replies: true }
end
it 'returns http success' do
expect(response).to have_http_status(200)
end
it 'returns posts along with self replies' do
it 'returns posts along with self replies', :aggregate_failures do
json = body_as_json
post_ids = json.map { |item| item[:id].to_i }.sort
expect(response).to have_http_status(200)
expect(post_ids).to eq [status.id, status_self_reply.id]
end
end