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:
commit
dd77e1bbfe
2 changed files with 23 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
18
actionpack/test/dispatch/runner_test.rb
Normal file
18
actionpack/test/dispatch/runner_test.rb
Normal 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
|
Loading…
Reference in a new issue