aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/test_process.rb9
2 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 2cd5abeda8..2923232021 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that controller tests can now assert on the use of cookies #466 [Alexey]
+
* Fixed that send_file would "remember" all the files sent by adding to the headers again and again #458 [bitsweat]
* Fixed url rewriter confusion when the controller or action name was a substring of the controller_prefix or action_prefix
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: