1
0
mirror of https://github.com/mastodon/mastodon synced 2024-11-24 07:06:18 +09:00

Reduce RSpec/MultipleExpectations in instance_actors_controller spec (#29229)

This commit is contained in:
Matt Jankowski 2024-02-16 08:00:11 -05:00 committed by GitHub
parent bba488c189
commit 1690fb39e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,17 +13,19 @@ RSpec.describe InstanceActorsController do
end end
it 'returns http success with correct media type, headers, and session values' do it 'returns http success with correct media type, headers, and session values' do
expect(response).to have_http_status(200) expect(response)
.to have_http_status(200)
.and have_attributes(
media_type: eq('application/activity+json'),
cookies: be_empty
)
expect(response.media_type).to eq 'application/activity+json' expect(response.headers)
.to include('Cache-Control' => include('public'))
expect(response.cookies).to be_empty .and not_include('Set-Cookies')
expect(response.headers['Set-Cookies']).to be_nil
expect(session).to be_empty expect(session).to be_empty
expect(response.headers['Cache-Control']).to include 'public'
expect(body_as_json) expect(body_as_json)
.to include(:id, :type, :preferredUsername, :inbox, :publicKey, :inbox, :outbox, :url) .to include(:id, :type, :preferredUsername, :inbox, :publicKey, :inbox, :outbox, :url)
end end