Skip to content

Commit 333ed2f

Browse files
committed
refactor: Simplify error handling tests in EventReminderJob spec
1 parent fb62b95 commit 333ed2f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

spec/jobs/better_together/event_reminder_job_spec.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,16 @@ module BetterTogether
5656
end
5757
end
5858

59-
describe 'retry and error handling' do
60-
it 'handles errors gracefully' do
61-
allow_any_instance_of(described_class).to receive(:find_event).and_raise(StandardError, 'Test error')
59+
describe 'error handling' do
60+
it 'handles missing events gracefully' do
6261
expect do
63-
described_class.perform_now(event)
62+
described_class.perform_now(999_999)
6463
end.not_to raise_error
6564
end
6665

67-
it 'handles missing events gracefully' do
66+
it 'handles invalid event IDs gracefully' do
6867
expect do
69-
described_class.perform_now(999_999)
68+
described_class.perform_now(nil)
7069
end.not_to raise_error
7170
end
7271
end

0 commit comments

Comments
 (0)