diff options
author | BatedUrGonnaDie <batedurgonnadie@yahoo.com> | 2019-04-09 00:35:16 -0700 |
---|---|---|
committer | BatedUrGonnaDie <batedurgonnadie@yahoo.com> | 2019-04-09 00:35:16 -0700 |
commit | 75811c37a9c1cc7d6977cd841437d136d4b95440 (patch) | |
tree | b92c2322bc4a32800151834c69e24c42ac808620 /railties/test | |
parent | 496e8ee9370e9f165fd1f5d2620296299a6a8649 (diff) | |
download | rails-75811c37a9c1cc7d6977cd841437d136d4b95440.tar.gz rails-75811c37a9c1cc7d6977cd841437d136d4b95440.tar.bz2 rails-75811c37a9c1cc7d6977cd841437d136d4b95440.zip |
Only override async adapter when seeding
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/engine_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 69f6e34d58..fe5c62c07d 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -879,7 +879,7 @@ YAML assert Bukkits::Engine.config.bukkits_seeds_loaded end - test "jobs are ran inline while loading seeds" do + test "jobs are ran inline while loading seeds with async adapter configured" do app_file "db/seeds.rb", <<-RUBY Rails.application.config.seed_queue_adapter = ActiveJob::Base.queue_adapter RUBY @@ -891,6 +891,19 @@ YAML assert_instance_of ActiveJob::QueueAdapters::AsyncAdapter, ActiveJob::Base.queue_adapter end + test "jobs are ran with original adapter while loading seeds with custom adapter configured" do + app_file "db/seeds.rb", <<-RUBY + Rails.application.config.seed_queue_adapter = ActiveJob::Base.queue_adapter + RUBY + + boot_rails + Rails.application.config.active_job.queue_adapter = :delayed_job + Rails.application.load_seed + + assert_instance_of ActiveJob::QueueAdapters::DelayedJobAdapter, Rails.application.config.seed_queue_adapter + assert_instance_of ActiveJob::QueueAdapters::DelayedJobAdapter, ActiveJob::Base.queue_adapter + end + test "skips nonexistent seed data" do FileUtils.rm "#{app_path}/db/seeds.rb" boot_rails |