diff options
author | Matthew Draper <matthew@trebex.net> | 2016-03-02 02:56:53 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-03-02 02:56:53 +1030 |
commit | 541e4abb4b3710a384aefac83cafd0ab878c60bf (patch) | |
tree | 55603da9b6f9407a24c68e1d1fd53e109c4131e7 /actionpack/lib/action_dispatch/testing | |
parent | ecdc0fbc872ea734adf29b3f9f3463b916235286 (diff) | |
parent | 60b53e9883bfd9f4edb640dbe2de89227b875e09 (diff) | |
download | rails-541e4abb4b3710a384aefac83cafd0ab878c60bf.tar.gz rails-541e4abb4b3710a384aefac83cafd0ab878c60bf.tar.bz2 rails-541e4abb4b3710a384aefac83cafd0ab878c60bf.zip |
Merge pull request #23807 from matthewd/executor
Publish AS::Executor and AS::Reloader APIs
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index f4534b4173..e871ddd289 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -455,17 +455,24 @@ module ActionDispatch def before_setup # :nodoc: @app = nil @integration_session = nil + @execution_context = nil + super + end + + def after_teardown # :nodoc: + remove! super end def integration_session - @integration_session ||= create_session(app) + @integration_session ||= create_session(app).tap { @execution_context = app.respond_to?(:executor) && app.executor.run! } end # Reset the current session. This is useful for testing multiple sessions # in a single test case. def reset! - @integration_session = create_session(app) + remove! + integration_session end def create_session(app) @@ -481,6 +488,8 @@ module ActionDispatch end def remove! # :nodoc: + @execution_context.complete! if @execution_context + @execution_context = nil @integration_session = nil end |