aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-10-12 07:49:35 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2012-10-12 07:49:44 -0700
commit79db8db415ffb86ab23e4d319c1035d926160d2d (patch)
tree51f9b8ce7350a109dc1c9996fdab569430f1eb0b /railties
parentf1765019ce9b6292f2264b4601dad5daaffe3a89 (diff)
downloadrails-79db8db415ffb86ab23e4d319c1035d926160d2d.tar.gz
rails-79db8db415ffb86ab23e4d319c1035d926160d2d.tar.bz2
rails-79db8db415ffb86ab23e4d319c1035d926160d2d.zip
Immediately run queued jobs in tests. Otherwise you have to explicitly drain the queue to actually deliver your emails.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt4
-rw-r--r--railties/test/application/queue_test.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt
index 202fc98adf..fe2820f64e 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt
+++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt
@@ -34,6 +34,6 @@
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
- # Use the testing queue.
- config.queue = ActiveSupport::TestQueue
+ # Use the synchronous queue to run jobs immediately.
+ config.queue = ActiveSupport::SynchronousQueue
end
diff --git a/railties/test/application/queue_test.rb b/railties/test/application/queue_test.rb
index e67c6cc371..5e7b938cbb 100644
--- a/railties/test/application/queue_test.rb
+++ b/railties/test/application/queue_test.rb
@@ -17,10 +17,10 @@ module ApplicationTests
@app_const ||= Class.new(Rails::Application)
end
- test "the queue is a TestQueue in test mode" do
+ test "the queue is a SynchronousQueue in test mode" do
app("test")
- assert_kind_of ActiveSupport::TestQueue, Rails.application.queue[:default]
- assert_kind_of ActiveSupport::TestQueue, Rails.queue[:default]
+ assert_kind_of ActiveSupport::SynchronousQueue, Rails.application.queue[:default]
+ assert_kind_of ActiveSupport::SynchronousQueue, Rails.queue[:default]
end
test "the queue is a SynchronousQueue in development mode" do