diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:35:13 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:35:13 +0200 |
commit | 5b6eb1d58b48fada298215b2cccda89f993890c3 (patch) | |
tree | a48010fd8c35588540f50df257a76347091aca12 /actionpack/test/dispatch/session | |
parent | 12a70404cd164008879e63cc320356e6afee3adc (diff) | |
download | rails-5b6eb1d58b48fada298215b2cccda89f993890c3.tar.gz rails-5b6eb1d58b48fada298215b2cccda89f993890c3.tar.bz2 rails-5b6eb1d58b48fada298215b2cccda89f993890c3.zip |
modernizes hash syntax in actionpack
Diffstat (limited to 'actionpack/test/dispatch/session')
-rw-r--r-- | actionpack/test/dispatch/session/cache_store_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/dispatch/session/cookie_store_test.rb | 20 | ||||
-rw-r--r-- | actionpack/test/dispatch/session/mem_cache_store_test.rb | 4 |
3 files changed, 14 insertions, 14 deletions
diff --git a/actionpack/test/dispatch/session/cache_store_test.rb b/actionpack/test/dispatch/session/cache_store_test.rb index 96793b3280..5252d93850 100644 --- a/actionpack/test/dispatch/session/cache_store_test.rb +++ b/actionpack/test/dispatch/session/cache_store_test.rb @@ -165,13 +165,13 @@ class CacheStoreTest < ActionDispatch::IntegrationTest with_routing do |set| set.draw do ActiveSupport::Deprecation.silence do - get ":action", :to => ::CacheStoreTest::TestController + get ":action", to: ::CacheStoreTest::TestController end end @app = self.class.build_app(set) do |middleware| @cache = ActiveSupport::Cache::MemoryStore.new - middleware.use ActionDispatch::Session::CacheStore, :key => "_session_id", :cache => @cache + middleware.use ActionDispatch::Session::CacheStore, key: "_session_id", cache: @cache middleware.delete ActionDispatch::ShowExceptions end 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 diff --git a/actionpack/test/dispatch/session/mem_cache_store_test.rb b/actionpack/test/dispatch/session/mem_cache_store_test.rb index 40594ed61d..c2d0719b4e 100644 --- a/actionpack/test/dispatch/session/mem_cache_store_test.rb +++ b/actionpack/test/dispatch/session/mem_cache_store_test.rb @@ -188,12 +188,12 @@ class MemCacheStoreTest < ActionDispatch::IntegrationTest with_routing do |set| set.draw do ActiveSupport::Deprecation.silence do - get ":action", :to => ::MemCacheStoreTest::TestController + get ":action", to: ::MemCacheStoreTest::TestController end end @app = self.class.build_app(set) do |middleware| - middleware.use ActionDispatch::Session::MemCacheStore, :key => "_session_id", :namespace => "mem_cache_store_test:#{SecureRandom.hex(10)}" + middleware.use ActionDispatch::Session::MemCacheStore, key: "_session_id", namespace: "mem_cache_store_test:#{SecureRandom.hex(10)}" middleware.delete ActionDispatch::ShowExceptions end |