Skip to content

Commit

Permalink
Improve tests to quiet new warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zachahn committed Aug 10, 2024
1 parent efa21a9 commit a51b0e1
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test/models/disqualified/record_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ def perform

test ".claim_one! claims requeued jobs" do
NoArgJob.perform_async
claimed_record = Disqualified::Record.claim_one!
claimed_record.unqueue
Disqualified::Record.claim_one!
assert_difference("Disqualified::Record.first.attempts", 2) do
assert_difference("Disqualified::Record.first.attempts", 1) do
claimed_record = Disqualified::Record.claim_one!
claimed_record.unqueue
end
assert_difference("Disqualified::Record.first.attempts", 1) do
Disqualified::Record.claim_one!
end
end
end

test "#run doesn't run ran jobs" do
Expand All @@ -49,7 +55,11 @@ def perform
test "#run runs jobs" do
NoArgJob.perform_async
record = Disqualified::Record.runnable.first
record.run!
assert_difference("record.reload.attempts", 1) do
assert_changes("record.reload.finished_at") do
record.run!
end
end
end

test "#instantiate_handler_and_perform_with_args" do
Expand Down

0 comments on commit a51b0e1

Please sign in to comment.