mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Define a SynchronousQueue for test in Action Pack.
We don't need to rely on rails/queueing in Action Pack tests
This commit is contained in:
parent
45537f00b4
commit
d0c25f253f
2 changed files with 10 additions and 6 deletions
|
@ -26,7 +26,6 @@ require 'active_model'
|
|||
require 'active_record'
|
||||
require 'action_controller/caching'
|
||||
require 'action_controller/caching/sweeping'
|
||||
require 'rails/queueing'
|
||||
|
||||
require 'pp' # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late
|
||||
|
||||
|
@ -35,11 +34,6 @@ module Rails
|
|||
def env
|
||||
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
|
||||
end
|
||||
|
||||
def queue
|
||||
@queue ||= Rails::Queueing::Container.new(Rails::Queueing::SynchronousQueue.new)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -10,6 +10,16 @@ require 'controller/fake_controllers'
|
|||
require 'action_mailer'
|
||||
ActionMailer::Base.view_paths = FIXTURE_LOAD_PATH
|
||||
|
||||
class SynchronousQueue < Queue
|
||||
def push(job)
|
||||
job.run
|
||||
end
|
||||
alias << push
|
||||
alias enq push
|
||||
end
|
||||
|
||||
ActionMailer::Base.queue = SynchronousQueue.new
|
||||
|
||||
class AssertSelectTest < ActionController::TestCase
|
||||
Assertion = ActiveSupport::TestCase::Assertion
|
||||
|
||||
|
|
Loading…
Reference in a new issue