diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-10-13 09:54:34 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-10-13 09:54:34 -0700 |
commit | 1fd89260566eae1b8d3531bf83233eb18c27ab3d (patch) | |
tree | 93dd1a755b5f913cf080768136c527b9a262f99f /railties/test | |
parent | c8fe0d58bcc7deb49711606566c854bf0ed7f107 (diff) | |
download | rails-1fd89260566eae1b8d3531bf83233eb18c27ab3d.tar.gz rails-1fd89260566eae1b8d3531bf83233eb18c27ab3d.tar.bz2 rails-1fd89260566eae1b8d3531bf83233eb18c27ab3d.zip |
Test that a Rails.queue consumer is automatically started in production
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/queue_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/railties/test/application/queue_test.rb b/railties/test/application/queue_test.rb index b4c9a31185..b0b3cf18e9 100644 --- a/railties/test/application/queue_test.rb +++ b/railties/test/application/queue_test.rb @@ -69,6 +69,17 @@ module ApplicationTests refute job.ran_in_different_thread?, "Expected job to run in the same thread" end + test "in production, automatically spawn a queue consumer in a background thread" do + add_to_env_config "production", <<-RUBY + config.queue = ActiveSupport::Queue.new + RUBY + + app("production") + + assert_nil Rails.application.config.queue_consumer + assert_kind_of ActiveSupport::ThreadedQueueConsumer, Rails.application.queue_consumer + end + test "attempting to marshal a queue will raise an exception" do app("test") assert_raises TypeError do @@ -123,7 +134,6 @@ module ApplicationTests def start @started = true - self end end RUBY |