Combine double subject in `well_known/webfinger` shared example (#28944)
parent
09a3493fca
commit
d791bca11b
|
@ -17,22 +17,18 @@ describe 'The /.well-known/webfinger endpoint' do
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'a successful response' do
|
shared_examples 'a successful response' do
|
||||||
it 'returns http success' do
|
it 'returns http success with correct media type and headers and body json' do
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
end
|
|
||||||
|
|
||||||
it 'sets only a Vary Origin header' do
|
|
||||||
expect(response.headers['Vary']).to eq('Origin')
|
expect(response.headers['Vary']).to eq('Origin')
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns application/jrd+json' do
|
|
||||||
expect(response.media_type).to eq 'application/jrd+json'
|
expect(response.media_type).to eq 'application/jrd+json'
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns links for the account' do
|
expect(body_as_json)
|
||||||
json = body_as_json
|
.to include(
|
||||||
expect(json[:subject]).to eq 'acct:alice@cb6e6126.ngrok.io'
|
subject: eq('acct:alice@cb6e6126.ngrok.io'),
|
||||||
expect(json[:aliases]).to include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
|
aliases: include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue