diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2019-04-09 15:24:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-09 15:24:08 -0400 |
commit | d5f2deb1539927c8793588e7d1e86d84211d4da8 (patch) | |
tree | 9eb9903254b425e502db518f1f8425ed6d8dd0b4 /railties/test | |
parent | dd58d040b2b798105b95e21396e86266bfd40de9 (diff) | |
parent | 75811c37a9c1cc7d6977cd841437d136d4b95440 (diff) | |
download | rails-d5f2deb1539927c8793588e7d1e86d84211d4da8.tar.gz rails-d5f2deb1539927c8793588e7d1e86d84211d4da8.tar.bz2 rails-d5f2deb1539927c8793588e7d1e86d84211d4da8.zip |
Merge pull request #35905 from BatedUrGonnaDie/dont-override-job-seed-adapter
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 |