aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/session/cookie_store_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch/session/cookie_store_test.rb')
-rw-r--r--actionpack/test/dispatch/session/cookie_store_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb
index c741f486ea..1dbaa2ab00 100644
--- a/actionpack/test/dispatch/session/cookie_store_test.rb
+++ b/actionpack/test/dispatch/session/cookie_store_test.rb
@@ -7,8 +7,8 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
SessionSecret = "b3c631c314c0bbca50c1b2843150fe33"
Generator = ActiveSupport::LegacyKeyGenerator.new(SessionSecret)
- Verifier = ActiveSupport::MessageVerifier.new(SessionSecret, :digest => "SHA1")
- SignedBar = Verifier.generate(:foo => "bar", :session_id => SecureRandom.hex(16))
+ Verifier = ActiveSupport::MessageVerifier.new(SessionSecret, digest: "SHA1")
+ SignedBar = Verifier.generate(foo: "bar", session_id: SecureRandom.hex(16))
class TestController < ActionController::Base
def no_session_access
@@ -105,7 +105,7 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
end
def test_does_not_set_secure_cookies_over_http
- with_test_route_set(:secure => true) do
+ with_test_route_set(secure: true) do
get "/set_session_value"
assert_response :success
assert_equal nil, headers["Set-Cookie"]
@@ -124,7 +124,7 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
end
def test_does_set_secure_cookies_over_https
- with_test_route_set(:secure => true) do
+ with_test_route_set(secure: true) do
get "/set_session_value", headers: { "HTTPS" => "on" }
assert_response :success
assert_equal "_myapp_session=#{response.body}; path=/; secure; HttpOnly",
@@ -271,7 +271,7 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
end
def test_session_store_with_expire_after
- with_test_route_set(:expire_after => 5.hours) do
+ with_test_route_set(expire_after: 5.hours) do
# First request accesses the session
time = Time.local(2008, 4, 24)
cookie_body = nil
@@ -304,7 +304,7 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
end
def test_session_store_with_explicit_domain
- with_test_route_set(:domain => "example.es") do
+ with_test_route_set(domain: "example.es") do
get "/set_session_value"
assert_match(/domain=example\.es/, headers["Set-Cookie"])
headers["Set-Cookie"]
@@ -319,14 +319,14 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
end
def test_session_store_with_nil_domain
- with_test_route_set(:domain => nil) do
+ with_test_route_set(domain: nil) do
get "/set_session_value"
assert_no_match(/domain\=/, headers["Set-Cookie"])
end
end
def test_session_store_with_all_domains
- with_test_route_set(:domain => :all) do
+ with_test_route_set(domain: :all) do
get "/set_session_value"
assert_match(/domain=\.example\.com/, headers["Set-Cookie"])
end
@@ -346,11 +346,11 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
with_routing do |set|
set.draw do
ActiveSupport::Deprecation.silence do
- get ":action", :to => ::CookieStoreTest::TestController
+ get ":action", to: ::CookieStoreTest::TestController
end
end
- options = { :key => SessionKey }.merge!(options)
+ options = { key: SessionKey }.merge!(options)
@app = self.class.build_app(set) do |middleware|
middleware.use ActionDispatch::Session::CookieStore, options