1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed that controller tests can now assert on the use of cookies #466 [Alexey]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-01-13 14:01:17 +00:00
parent 4cee51e1cc
commit 1d61071e7c
2 changed files with 11 additions and 0 deletions

View file

@ -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

View file

@ -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: