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

@ -13,6 +13,7 @@ RSpec.describe AccountControllerConcern do
before do
routes.draw { get 'success' => 'anonymous#success' }
request.host = Rails.configuration.x.local_domain
end
context 'when account is unconfirmed' do
@ -56,8 +57,8 @@ RSpec.describe AccountControllerConcern do
expect(response)
.to have_http_status(200)
.and have_http_link_header('http://test.host/.well-known/webfinger?resource=acct%3Ausername%40cb6e6126.ngrok.io').for(rel: 'lrdd', type: 'application/jrd+json')
.and have_http_link_header('https://cb6e6126.ngrok.io/users/username').for(rel: 'alternate', type: 'application/activity+json')
.and have_http_link_header(webfinger_url(resource: account.to_webfinger_s)).for(rel: 'lrdd', type: 'application/jrd+json')
.and have_http_link_header(account_url(account, protocol: :https)).for(rel: 'alternate', type: 'application/activity+json')
expect(response.body)
.to include(account.username)
end