Merge commit 'db0cd9489c70e985da961a585f3a809ca449dccf' into glitch-soc/merge-upstream

Conflicts:
- `app/services/post_status_service.rb`:
  Upstream updated the logic to move the CW to the text content.
  Glitch-soc does not move CW to text content but has some logic
  to avoid the text being empty. Update the logic according to upstream's
  change.
- `docker-compose.yml`:
  Conflict because of different paths for composer images.
  Updated version as upstream did while keeping our path.
This commit is contained in:
Claire
2025-09-17 20:10:28 +02:00
4 changed files with 55 additions and 4 deletions

View File

@@ -226,6 +226,29 @@ RSpec.describe '/api/v1/statuses' do
end
end
context 'with a self-quote post and a CW but no text', feature: :outgoing_quotes do
let(:quoted_status) { Fabricate(:status, account: user.account) }
let(:params) do
{
spoiler_text: 'this is a CW',
quoted_status_id: quoted_status.id,
}
end
it 'returns a quote post, as well as rate limit headers', :aggregate_failures do
subject
expect(response).to have_http_status(200)
expect(response.content_type)
.to start_with('application/json')
expect(response.parsed_body[:quote]).to be_present
expect(response.parsed_body[:spoiler_text]).to eq 'this is a CW'
expect(response.parsed_body[:content]).to eq ''
expect(response.headers['X-RateLimit-Limit']).to eq RateLimiter::FAMILIES[:statuses][:limit].to_s
expect(response.headers['X-RateLimit-Remaining']).to eq (RateLimiter::FAMILIES[:statuses][:limit] - 1).to_s
end
end
context 'with a safeguard' do
let!(:alice) { Fabricate(:account, username: 'alice') }
let!(:bob) { Fabricate(:account, username: 'bob') }