aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/test_process.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb
index f49b2dd3bf..6fd5249836 100644
--- a/actionpack/lib/action_controller/test_process.rb
+++ b/actionpack/lib/action_controller/test_process.rb
@@ -182,6 +182,15 @@ module ActionController #:nodoc:
def has_template_object?(name=nil)
!template_objects[name].nil?
end
+
+ # Returns the response cookies, converted to a Hash of (name => CGI::Cookie) pairs
+ # Example:
+ #
+ # assert_equal ['AuthorOfNewPage'], r.cookies['author'].value
+ def cookies
+ headers['cookie'].inject({}) { |hash, cookie| hash[cookie.name] = cookie; hash }
+ end
+
end
class TestSession #:nodoc: