Skip to content

Commit

Permalink
Explicitly default to the test adapter in tests
Browse files Browse the repository at this point in the history
It already is using the test adapter but it really should be good_job.
Right now that isn't the case because of a bug in rails which is fixed in 7.2
So, prepare for that
  • Loading branch information
Earlopain committed Jun 21, 2024
1 parent dbe88f2 commit 1a10ba3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

config.active_job.queue_adapter = :test

# While tests run files are not watched, reloading is not necessary.
config.enable_reloading = false

Expand Down
6 changes: 5 additions & 1 deletion test/logical/job_stats_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

require "test_helper"

class JobStatsTest < ActiveSupport::TestCase
class JobStatsTest < ActiveJob::TestCase
def queue_adapter_for_test
ActiveJob::QueueAdapters::GoodJobAdapter.new
end

it "returns enqueued jobs" do
url1 = create(:artist_url)
submission1, submission2 = create_list(:artist_submission, 2, artist_url: url1)
Expand Down

0 comments on commit 1a10ba3

Please sign in to comment.