Permalink
Browse files

Ruby 1.9 compat: account for new, non-flattening Array#to_s

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8407 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f85089a commit a3143eaa98c981efe0c7f82c3168fdc8fc0bcef2 @jeremy jeremy committed Dec 15, 2007
Showing with 4 additions and 4 deletions.
  1. +3 −3 actionpack/lib/action_controller/cookies.rb
  2. +1 −1 actionpack/test/controller/cookie_test.rb
@@ -50,8 +50,8 @@ def initialize(controller)
def [](name)
cookie = @cookies[name.to_s]
if cookie && cookie.respond_to?(:value)
- cookie.size > 1 ? cookie.value : cookie.value.to_s
- end
+ cookie.size > 1 ? cookie.value : cookie.value[0]
+ end
end
def []=(name, options)
@@ -81,4 +81,4 @@ def set_cookie(options) #:doc:
@controller.response.headers["cookie"] << cookie
end
end
-end
+end
@@ -67,7 +67,7 @@ def test_setting_cookie_for_fourteen_days_with_symbols
def test_setting_cookie_with_http_only
get :authenticate_with_http_only
assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "http_only" => true) ], @response.headers["cookie"]
- assert_equal CGI::Cookie::new("name" => "user_name", "value" => "david", "path" => "/", "http_only" => true).to_s, @response.headers["cookie"].to_s
+ assert_equal CGI::Cookie::new("name" => "user_name", "value" => "david", "path" => "/", "http_only" => true).to_s, @response.headers["cookie"][0].to_s
end
def test_multiple_cookies

0 comments on commit a3143ea

Please sign in to comment.