aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/cookies_test.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-01-06 04:18:54 -0500
committerGitHub <noreply@github.com>2017-01-06 04:18:54 -0500
commit5eff7a9ca7bb2ee7f16db1ab4d11cebe28757ba5 (patch)
tree427d127b00c6316498dabbd5d13f5909d75d7177 /actionpack/test/dispatch/cookies_test.rb
parent5f03172f54a58a57a48a3121562beb2cef866cbe (diff)
parentc5da6414715e3e61f6e51a40245525aa9504a6f3 (diff)
downloadrails-5eff7a9ca7bb2ee7f16db1ab4d11cebe28757ba5.tar.gz
rails-5eff7a9ca7bb2ee7f16db1ab4d11cebe28757ba5.tar.bz2
rails-5eff7a9ca7bb2ee7f16db1ab4d11cebe28757ba5.zip
Merge pull request #27586 from maclover7/jm-fix-27584
Update `cookies` helper on all HTTP requests
Diffstat (limited to 'actionpack/test/dispatch/cookies_test.rb')
-rw-r--r--actionpack/test/dispatch/cookies_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb
index 664faa31bb..73ad677419 100644
--- a/actionpack/test/dispatch/cookies_test.rb
+++ b/actionpack/test/dispatch/cookies_test.rb
@@ -395,6 +395,15 @@ class CookiesTest < ActionController::TestCase
assert_equal false, cookies.deleted?("another")
end
+ # Ensure all HTTP methods have their cookies updated
+ [:get, :post, :patch, :put, :delete, :head].each do |method|
+ define_method("test_deleting_cookie_#{method}") do
+ request.cookies[:user_name] = "Joe"
+ public_send method, :logout
+ assert_nil cookies[:user_name]
+ end
+ end
+
def test_deleted_cookie_predicate_with_mismatching_options
cookies[:user_name] = "Joe"
cookies.delete("user_name", path: "/path")