diff options
author | Joshua Peek <josh@joshpeek.com> | 2012-10-15 10:20:50 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2012-10-15 10:20:50 -0500 |
commit | c800e27ad35ec46f32b5ac4428e5cf7141f95105 (patch) | |
tree | 0821e0afaba2a74dec6ea1397ee3cabfd3d10c59 /railties/test/application/middleware/cache_test.rb | |
parent | 7dba1599d9092a8362956a3fab23b2c60eedea63 (diff) | |
parent | 46dc6e7786222865309d15a9eaaaf55e3b7d9c1f (diff) | |
download | rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.tar.gz rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.tar.bz2 rails-c800e27ad35ec46f32b5ac4428e5cf7141f95105.zip |
Merge branch 'master' into asset-path-helper
Conflicts:
railties/test/application/configuration_test.rb
Diffstat (limited to 'railties/test/application/middleware/cache_test.rb')
-rw-r--r-- | railties/test/application/middleware/cache_test.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/railties/test/application/middleware/cache_test.rb b/railties/test/application/middleware/cache_test.rb index fffe79f9cc..9b6c76e7aa 100644 --- a/railties/test/application/middleware/cache_test.rb +++ b/railties/test/application/middleware/cache_test.rb @@ -19,17 +19,17 @@ module ApplicationTests controller :expires, <<-RUBY class ExpiresController < ApplicationController def expires_header - expires_in 10, :public => !params[:private] - render :text => SecureRandom.hex(16) + expires_in 10, public: !params[:private] + render text: SecureRandom.hex(16) end def expires_etag - render_conditionally(:etag => "1") + render_conditionally(etag: "1") end def expires_last_modified $last_modified ||= Time.now.utc - render_conditionally(:last_modified => $last_modified) + render_conditionally(last_modified: $last_modified) end def keeps_if_modified_since @@ -37,8 +37,8 @@ module ApplicationTests end private def render_conditionally(headers) - if stale?(headers.merge(:public => !params[:private])) - render :text => SecureRandom.hex(16) + if stale?(headers.merge(public: !params[:private])) + render text: SecureRandom.hex(16) end end end @@ -96,13 +96,13 @@ module ApplicationTests def test_cache_works_with_expires_private simple_controller - get "/expires/expires_header", :private => true + get "/expires/expires_header", private: true assert_equal "miss", last_response.headers["X-Rack-Cache"] assert_equal "private, max-age=10", last_response.headers["Cache-Control"] body = last_response.body - get "/expires/expires_header", :private => true + get "/expires/expires_header", private: true assert_equal "miss", last_response.headers["X-Rack-Cache"] assert_not_equal body, last_response.body end @@ -125,14 +125,14 @@ module ApplicationTests def test_cache_works_with_etags_private simple_controller - get "/expires/expires_etag", :private => true + get "/expires/expires_etag", private: true assert_equal "miss", last_response.headers["X-Rack-Cache"] assert_equal "must-revalidate, private, max-age=0", last_response.headers["Cache-Control"] body = last_response.body etag = last_response.headers["ETag"] - get "/expires/expires_etag", {:private => true}, "If-None-Match" => etag + get "/expires/expires_etag", {private: true}, "If-None-Match" => etag assert_equal "miss", last_response.headers["X-Rack-Cache"] assert_not_equal body, last_response.body end @@ -155,14 +155,14 @@ module ApplicationTests def test_cache_works_with_last_modified_private simple_controller - get "/expires/expires_last_modified", :private => true + get "/expires/expires_last_modified", private: true assert_equal "miss", last_response.headers["X-Rack-Cache"] assert_equal "must-revalidate, private, max-age=0", last_response.headers["Cache-Control"] body = last_response.body last = last_response.headers["Last-Modified"] - get "/expires/expires_last_modified", {:private => true}, "If-Modified-Since" => last + get "/expires/expires_last_modified", {private: true}, "If-Modified-Since" => last assert_equal "miss", last_response.headers["X-Rack-Cache"] assert_not_equal body, last_response.body end |