提交 dd77e1bb 编写于 作者: S Sean Griffin 提交者: GitHub

Merge pull request #26235 from samphippen/allow-early-setting-of-integration-session

Allow the `integration_sesion` to be set early on ActionDispatch::Integration::Runner.
......@@ -420,9 +420,13 @@ module Runner
attr_reader :app
def initialize(*args, &blk)
super(*args, &blk)
@integration_session = nil
end
def before_setup # :nodoc:
@app = nil
@integration_session = nil
super
end
......
require "abstract_unit"
class RunnerTest < ActiveSupport::TestCase
test "runner preserves the setting of integration_session" do
runner = Class.new do
def before_setup
end
end.new
runner.extend(ActionDispatch::Integration::Runner)
runner.integration_session.host! "lvh.me"
runner.before_setup
assert_equal "lvh.me", runner.integration_session.host
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册