aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-01-17 11:06:41 -0500
committerGitHub <noreply@github.com>2019-01-17 11:06:41 -0500
commit2dee59fed1e78b983aed4db53dc8fc59e49b9200 (patch)
treedb51feed99ce401fac39c463e19f9c8133b7bcb2 /railties/test
parent05350eda9b3f6689374a20711c946f530a8bbd6d (diff)
parent66cc0e768fb092dbcd12feb3387c2a22e4cbeb37 (diff)
downloadrails-2dee59fed1e78b983aed4db53dc8fc59e49b9200.tar.gz
rails-2dee59fed1e78b983aed4db53dc8fc59e49b9200.tar.bz2
rails-2dee59fed1e78b983aed4db53dc8fc59e49b9200.zip
Merge pull request #34953 from gmcgibbon/seed_with_inline_jobs
Seed database with inline ActiveJob job adapter
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/railties/engine_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb
index e62e8c8b44..508367212b 100644
--- a/railties/test/railties/engine_test.rb
+++ b/railties/test/railties/engine_test.rb
@@ -879,6 +879,18 @@ YAML
assert Bukkits::Engine.config.bukkits_seeds_loaded
end
+ test "jobs are ran inline while loading seeds" do
+ app_file "db/seeds.rb", <<-RUBY
+ Rails.application.config.seed_queue_adapter = ActiveJob::Base.queue_adapter
+ RUBY
+
+ boot_rails
+ Rails.application.load_seed
+
+ assert_instance_of ActiveJob::QueueAdapters::InlineAdapter, Rails.application.config.seed_queue_adapter
+ assert_instance_of ActiveJob::QueueAdapters::AsyncAdapter, ActiveJob::Base.queue_adapter
+ end
+
test "skips nonexistent seed data" do
FileUtils.rm "#{app_path}/db/seeds.rb"
boot_rails