diff options
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/cookies_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/dispatch/header_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/dispatch/test_request_test.rb | 7 |
3 files changed, 12 insertions, 5 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb index 38cf0a2346..6dcd62572a 100644 --- a/actionpack/test/dispatch/cookies_test.rb +++ b/actionpack/test/dispatch/cookies_test.rb @@ -68,7 +68,7 @@ class CookieJarTest < ActiveSupport::TestCase def test_write_doesnt_set_a_nil_header headers = {} request.cookie_jar.write(headers) - assert !headers.include?("Set-Cookie") + assert_not_includes headers, "Set-Cookie" end end @@ -1115,11 +1115,11 @@ class CookiesTest < ActionController::TestCase assert_equal "david", cookies[:user_name] get :noop - assert !@response.headers.include?("Set-Cookie") + assert_not_includes @response.headers, "Set-Cookie" assert_equal "david", cookies[:user_name] get :noop - assert !@response.headers.include?("Set-Cookie") + assert_not_includes @response.headers, "Set-Cookie" assert_equal "david", cookies[:user_name] end diff --git a/actionpack/test/dispatch/header_test.rb b/actionpack/test/dispatch/header_test.rb index 374e618b42..6febd5cb68 100644 --- a/actionpack/test/dispatch/header_test.rb +++ b/actionpack/test/dispatch/header_test.rb @@ -76,9 +76,9 @@ class HeaderTest < ActiveSupport::TestCase test "key?" do assert @headers.key?("CONTENT_TYPE") - assert @headers.include?("CONTENT_TYPE") + assert_includes @headers, "CONTENT_TYPE" assert @headers.key?("Content-Type") - assert @headers.include?("Content-Type") + assert_includes @headers, "Content-Type" end test "fetch with block" do diff --git a/actionpack/test/dispatch/test_request_test.rb b/actionpack/test/dispatch/test_request_test.rb index 35af3076ba..b479af781d 100644 --- a/actionpack/test/dispatch/test_request_test.rb +++ b/actionpack/test/dispatch/test_request_test.rb @@ -88,6 +88,13 @@ class TestRequestTest < ActiveSupport::TestCase assert_equal "GoogleBot", req.user_agent end + test "request_method getter and setter" do + req = ActionDispatch::TestRequest.create + req.request_method # to reproduce bug caused by memoization + req.request_method = "POST" + assert_equal "POST", req.request_method + end + test "setter methods" do req = ActionDispatch::TestRequest.create({}) get = "GET" |