From ed4939296a2f0ecf5d072c4f04c2733170038fa4 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 16 Feb 2024 02:43:00 -0500 Subject: [PATCH] Reduce `RSpec/MultipleExpectations` in ap/activity/create spec (#29224) --- spec/lib/activitypub/activity/create_spec.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/spec/lib/activitypub/activity/create_spec.rb b/spec/lib/activitypub/activity/create_spec.rb index e4966cffa33..dec17b916b8 100644 --- a/spec/lib/activitypub/activity/create_spec.rb +++ b/spec/lib/activitypub/activity/create_spec.rb @@ -970,12 +970,15 @@ RSpec.describe ActivityPub::Activity::Create do it 'creates an encrypted message' do encrypted_message = target_device.encrypted_messages.reload.first - expect(encrypted_message).to_not be_nil - expect(encrypted_message.from_device_id).to eq '1234' - expect(encrypted_message.from_account).to eq sender - expect(encrypted_message.type).to eq 1 - expect(encrypted_message.body).to eq 'Foo' - expect(encrypted_message.digest).to eq 'Foo123' + expect(encrypted_message) + .to be_present + .and have_attributes( + from_device_id: eq('1234'), + from_account: eq(sender), + type: eq(1), + body: eq('Foo'), + digest: eq('Foo123') + ) end it 'creates a message franking' do