From f87959ab501ebb63444832369f0fb452768a0a8a Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 2 Apr 2024 10:05:02 -0400 Subject: [PATCH] Fix `RSpec/LetSetup` cop in api/v1/timelines/public spec (#28972) --- spec/requests/api/v1/timelines/public_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/requests/api/v1/timelines/public_spec.rb b/spec/requests/api/v1/timelines/public_spec.rb index 30d1bc00cb..364e48d3d2 100644 --- a/spec/requests/api/v1/timelines/public_spec.rb +++ b/spec/requests/api/v1/timelines/public_spec.rb @@ -22,13 +22,15 @@ describe 'Public' do get '/api/v1/timelines/public', headers: headers, params: params end - let!(:private_status) { Fabricate(:status, visibility: :private) } # rubocop:disable RSpec/LetSetup let!(:local_status) { Fabricate(:status, account: Fabricate.build(:account, domain: nil)) } let!(:remote_status) { Fabricate(:status, account: Fabricate.build(:account, domain: 'example.com')) } let!(:media_status) { Fabricate(:status, media_attachments: [Fabricate.build(:media_attachment)]) } - let(:params) { {} } + before do + Fabricate(:status, visibility: :private) + end + context 'when the instance allows public preview' do let(:expected_statuses) { [local_status, remote_status, media_status] }