mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Use more generic test env flag
This commit is contained in:
@@ -120,7 +120,7 @@ module ActionController
|
||||
def checkin_connections
|
||||
# Don't return connection (and peform implicit rollback) if this request is a part of integration test
|
||||
# TODO: This callback should have direct access to env
|
||||
return if @request.key?("action_controller.test")
|
||||
return if @request.key?("rack.test")
|
||||
ActiveRecord::Base.clear_active_connections!
|
||||
end
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ module ActionController
|
||||
@app.call(env)
|
||||
rescue Exception => exception
|
||||
# Reraise exception in test environment
|
||||
if env["action_controller.test"]
|
||||
if env["rack.test"]
|
||||
raise exception
|
||||
else
|
||||
failsafe_response(exception)
|
||||
|
||||
@@ -291,7 +291,7 @@ module ActionController
|
||||
"rack.multiprocess" => true,
|
||||
"rack.run_once" => false,
|
||||
|
||||
"action_controller.test" => true
|
||||
"rack.test" => true
|
||||
)
|
||||
|
||||
(headers || {}).each do |key, value|
|
||||
|
||||
Reference in New Issue
Block a user