Remove double `subject` in api/v1/accounts/relationships spec (#27839)
parent
4aa06cbdbf
commit
5e2ecc736d
|
@ -102,17 +102,25 @@ describe 'GET /api/v1/accounts/relationships' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns JSON with correct data on cached requests too' do
|
it 'returns JSON with correct data on previously cached requests' do
|
||||||
subject
|
# Initial request including multiple accounts in params
|
||||||
subject
|
get '/api/v1/accounts/relationships', headers: headers, params: { id: [simon.id, lewis.id] }
|
||||||
|
expect(body_as_json.size).to eq(2)
|
||||||
|
|
||||||
|
# Subsequent request with different id, should override cache from first request
|
||||||
|
get '/api/v1/accounts/relationships', headers: headers, params: { id: [simon.id] }
|
||||||
|
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
|
|
||||||
json = body_as_json
|
expect(body_as_json)
|
||||||
|
.to be_an(Enumerable)
|
||||||
expect(json).to be_a Enumerable
|
.and have_attributes(
|
||||||
expect(json.first[:following]).to be true
|
size: 1,
|
||||||
expect(json.first[:showing_reblogs]).to be true
|
first: hash_including(
|
||||||
|
following: true,
|
||||||
|
showing_reblogs: true
|
||||||
|
)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns JSON with correct data after change too' do
|
it 'returns JSON with correct data after change too' do
|
||||||
|
|
Loading…
Reference in New Issue