From d2fbf42b0eeaca9cbb4df0350d87e6c84f0cfaf4 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 20 Dec 2024 08:34:05 -0500 Subject: [PATCH] Avoid `validate: false` save in expired poll create activity spec (#33367) --- spec/lib/activitypub/activity/create_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/lib/activitypub/activity/create_spec.rb b/spec/lib/activitypub/activity/create_spec.rb index 34b6fb2978..342da29028 100644 --- a/spec/lib/activitypub/activity/create_spec.rb +++ b/spec/lib/activitypub/activity/create_spec.rb @@ -993,9 +993,9 @@ RSpec.describe ActivityPub::Activity::Create do context 'when a vote to an expired local poll' do let(:poll) do - poll = Fabricate.build(:poll, options: %w(Yellow Blue), expires_at: 1.day.ago) - poll.save(validate: false) - poll + travel_to 2.days.ago do + Fabricate(:poll, options: %w(Yellow Blue), expires_at: 1.day.from_now) + end end let!(:local_status) { Fabricate(:status, poll: poll) }