Reduce hard coding of LOCAL_DOMAIN env value throughout tests (#35025)

This commit is contained in:
Matt Jankowski 2025-06-13 03:58:22 -04:00 committed by GitHub
commit ab7f50ce4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 69 additions and 37 deletions

View file

@ -26,8 +26,8 @@ RSpec.describe 'The /.well-known/webfinger endpoint' do
expect(response.parsed_body)
.to include(
subject: eq('acct:alice@cb6e6126.ngrok.io'),
aliases: include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
subject: eq(alice.to_webfinger_s),
aliases: include("https://#{Rails.configuration.x.local_domain}/@alice", "https://#{Rails.configuration.x.local_domain}/users/alice")
)
end
end
@ -125,10 +125,14 @@ RSpec.describe 'The /.well-known/webfinger endpoint' do
expect(response.parsed_body)
.to include(
subject: 'acct:mastodon.internal@cb6e6126.ngrok.io',
aliases: ['https://cb6e6126.ngrok.io/actor']
subject: instance_actor.to_webfinger_s,
aliases: [instance_actor_url]
)
end
def instance_actor
Account.where(id: Account::INSTANCE_ACTOR_ID).first
end
end
context 'with no resource parameter' do