aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/test_case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/test_case.rb')
-rw-r--r--actionpack/lib/action_controller/test_case.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index 57dd605b51..7229c67f30 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -389,7 +389,9 @@ module ActionController
# Note that the request method is not verified. The different methods are
# available to make the tests more expressive.
def get(action, **args)
- process(action, method: "GET", **args)
+ res = process(action, method: "GET", **args)
+ cookies.update res.cookies
+ res
end
# Simulate a POST request with the given parameters and set/volley the response.
@@ -517,7 +519,6 @@ module ActionController
unless @request.cookie_jar.committed?
@request.cookie_jar.write(@response)
cookies.update(@request.cookie_jar.instance_variable_get(:@cookies))
- cookies.update(@response.cookies)
end
end
@response.prepare!
@@ -533,6 +534,7 @@ module ActionController
@request.delete_header "HTTP_ACCEPT"
end
@request.query_string = ""
+ @request.env.delete "PATH_INFO"
@response.sent!
end