mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 16:59:41 +00:00
Merge commit 'c644413f8a068490ddb8038441e5b59112e8294e' into glitch-soc/merge-upstream
This commit is contained in:
@@ -34,5 +34,14 @@ RSpec.describe 'Suggestions API' do
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
context 'when `follow_recommendation` FASP is enabled', feature: :fasp do
|
||||
it 'enqueues a retrieval job and adds a header to inform the client' do
|
||||
get '/api/v2/suggestions', headers: headers
|
||||
|
||||
expect(Fasp::FollowRecommendationWorker).to have_enqueued_sidekiq_job
|
||||
expect(response.headers['Mastodon-Async-Refresh']).to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -472,12 +472,12 @@ RSpec.describe 'Caching behavior' do
|
||||
context 'when enabling LIMITED_FEDERATION_MODE mode' do
|
||||
around do |example|
|
||||
ClimateControl.modify LIMITED_FEDERATION_MODE: 'true' do
|
||||
old_limited_federation_mode = Rails.configuration.x.limited_federation_mode
|
||||
Rails.configuration.x.limited_federation_mode = true
|
||||
old_limited_federation_mode = Rails.configuration.x.mastodon.limited_federation_mode
|
||||
Rails.configuration.x.mastodon.limited_federation_mode = true
|
||||
|
||||
example.run
|
||||
|
||||
Rails.configuration.x.limited_federation_mode = old_limited_federation_mode
|
||||
Rails.configuration.x.mastodon.limited_federation_mode = old_limited_federation_mode
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Instance actor endpoint' do
|
||||
describe 'GET /actor' do
|
||||
let!(:original_federation_mode) { Rails.configuration.x.limited_federation_mode }
|
||||
let!(:original_federation_mode) { Rails.configuration.x.mastodon.limited_federation_mode }
|
||||
|
||||
shared_examples 'instance actor endpoint' do
|
||||
before { get instance_actor_path(format: :json) }
|
||||
@@ -31,8 +31,8 @@ RSpec.describe 'Instance actor endpoint' do
|
||||
end
|
||||
|
||||
context 'with limited federation mode disabled' do
|
||||
before { Rails.configuration.x.limited_federation_mode = false }
|
||||
after { Rails.configuration.x.limited_federation_mode = original_federation_mode }
|
||||
before { Rails.configuration.x.mastodon.limited_federation_mode = false }
|
||||
after { Rails.configuration.x.mastodon.limited_federation_mode = original_federation_mode }
|
||||
|
||||
it_behaves_like 'instance actor endpoint'
|
||||
|
||||
@@ -44,8 +44,8 @@ RSpec.describe 'Instance actor endpoint' do
|
||||
end
|
||||
|
||||
context 'with limited federation mode enabled' do
|
||||
before { Rails.configuration.x.limited_federation_mode = true }
|
||||
after { Rails.configuration.x.limited_federation_mode = original_federation_mode }
|
||||
before { Rails.configuration.x.mastodon.limited_federation_mode = true }
|
||||
after { Rails.configuration.x.mastodon.limited_federation_mode = original_federation_mode }
|
||||
|
||||
it_behaves_like 'instance actor endpoint'
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ RSpec.describe 'Statuses' do
|
||||
include AccountsHelper
|
||||
|
||||
def site_hostname
|
||||
Rails.configuration.x.web_domain || Rails.configuration.x.local_domain
|
||||
local_domain_uri.host
|
||||
end
|
||||
|
||||
it 'has valid opengraph tags' do
|
||||
|
||||
@@ -176,7 +176,7 @@ RSpec.describe 'The /.well-known/webfinger endpoint' do
|
||||
|
||||
context 'with limited federation mode' do
|
||||
before do
|
||||
allow(Rails.configuration.x).to receive(:limited_federation_mode).and_return(true)
|
||||
allow(Rails.configuration.x.mastodon).to receive(:limited_federation_mode).and_return(true)
|
||||
end
|
||||
|
||||
it 'does not return avatar in response' do
|
||||
|
||||
Reference in New Issue
Block a user