aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/test_process.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/test_process.rb')
-rw-r--r--actionpack/lib/action_controller/test_process.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb
index d3c66dd5f2..1597f637fc 100644
--- a/actionpack/lib/action_controller/test_process.rb
+++ b/actionpack/lib/action_controller/test_process.rb
@@ -264,7 +264,12 @@ module ActionController #:nodoc:
#
# assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
def cookies
- headers['cookie'].inject({}) { |hash, cookie| hash[cookie.name] = cookie; hash }
+ cookies = {}
+ Array(headers['Set-Cookie']).each do |cookie|
+ key, value = cookie.split(";").first.split("=")
+ cookies[key] = [value].compact
+ end
+ cookies
end
# Returns binary content (downloadable file), converted to a String