1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Merge pull request #1635 from sj26/test-helpers-process-should-return-response

Fix test behaviour for rspec subject requests
This commit is contained in:
José Valim 2012-02-11 22:32:35 -08:00
commit eaae041b4c

View file

@ -15,9 +15,8 @@ module Devise
# Override process to consider warden.
def process(*)
result = nil
_catch_warden { result = super }
result
# Make sure we always return @response, a la ActionController::TestCase::Behaviour#process, even if warden interrupts
_catch_warden { super } || @response
end
# We need to setup the environment variables and the response in the controller.
@ -66,6 +65,8 @@ module Devise
protected
# Catch warden continuations and handle like the middleware would.
# Returns nil when interrupted, otherwise the normal result of the block.
def _catch_warden(&block)
result = catch(:warden, &block)