Skip to content

Commit

Permalink
Fixed that controller tests can now assert on the use of cookies rail…
Browse files Browse the repository at this point in the history
…s#466 [Alexey]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Jan 13, 2005
1 parent 4cee51e commit 1d61071
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 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
Expand Down
9 changes: 9 additions & 0 deletions actionpack/lib/action_controller/test_process.rb
Expand Up @@ -182,6 +182,15 @@ def template_objects
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:
Expand Down

0 comments on commit 1d61071

Please sign in to comment.