Skip to content

Commit

Permalink
Reset model job id in before hook to reliably check for state change
Browse files Browse the repository at this point in the history
Failing in CI - perhaps when ran in global context
  • Loading branch information
akabiru committed Nov 28, 2024
1 parent 64cecd3 commit 7aa3f2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/services/reminders/update_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@
describe "remind_at changed" do
subject { described_class.new(user:, model: model_instance).call(call_attributes) }

let(:model_instance) { create(:reminder, :scheduled, :with_unread_notifications, creator: user, job_id: 1) }
let(:model_instance) { create(:reminder, :scheduled, :with_unread_notifications, creator: user) }
let(:user) { create(:admin) }
let(:call_attributes) { { remind_at: 2.days.from_now } }

before do
model_instance.update(job_id: 1)
allow(Reminders::ScheduleReminderJob).to receive(:schedule)
.with(model_instance)
.and_return(instance_double(Reminders::ScheduleReminderJob, job_id: 2))
Expand Down

0 comments on commit 7aa3f2b

Please sign in to comment.