1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

Allow the `integration_sesion` to be set early on ActionDispatch::Integration::Runner.
This commit is contained in:
Sean Griffin 2016-08-24 12:43:19 -04:00 committed by GitHub
commit dd77e1bbfe
2 changed files with 23 additions and 1 deletions

View file

@ -420,9 +420,13 @@ module ActionDispatch
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

View file

@ -0,0 +1,18 @@
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