From d1d2278e7007daac2dd658041ec29151fb09b0ed Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 15 Oct 2024 09:10:29 -0400 Subject: [PATCH] Reduce factory creation (73 -> 64) in `PublicFeed` spec (#32491) --- spec/models/public_feed_spec.rb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/spec/models/public_feed_spec.rb b/spec/models/public_feed_spec.rb index 20fcdb002..5ea58cd16 100644 --- a/spec/models/public_feed_spec.rb +++ b/spec/models/public_feed_spec.rb @@ -54,24 +54,20 @@ RSpec.describe PublicFeed do context 'without a viewer' do let(:viewer) { nil } - it 'includes remote instances statuses' do - expect(subject).to include(remote_status.id) - end - - it 'includes local statuses' do - expect(subject).to include(local_status.id) + it 'includes remote instances statuses and local statuses' do + expect(subject) + .to include(remote_status.id) + .and include(local_status.id) end end context 'with a viewer' do let(:viewer) { Fabricate(:account, username: 'viewer') } - it 'includes remote instances statuses' do - expect(subject).to include(remote_status.id) - end - - it 'includes local statuses' do - expect(subject).to include(local_status.id) + it 'includes remote instances statuses and local statuses' do + expect(subject) + .to include(remote_status.id) + .and include(local_status.id) end end end