Skip to content
Browse files

Account for ignored cookie set by turbolinks

  • Loading branch information...
1 parent 1fc294f commit dcb05f264af2ebbd3bbff6e8473ebe27771eb4f1 @reed reed committed Jan 14, 2013
Showing with 6 additions and 6 deletions.
  1. +6 −6 railties/test/application/middleware/cache_test.rb
View
12 railties/test/application/middleware/cache_test.rb
@@ -81,8 +81,8 @@ def test_cache_works_with_expires
add_to_config "config.action_dispatch.rack_cache = true"
get "/expires/expires_header"
- assert_equal "miss, store", last_response.headers["X-Rack-Cache"]
- assert_equal "max-age=10, public", last_response.headers["Cache-Control"]
+ assert_equal "miss, ignore, store", last_response.headers["X-Rack-Cache"]
+ assert_equal "max-age=10, public", last_response.headers["Cache-Control"]
body = last_response.body
@@ -115,8 +115,8 @@ def test_cache_works_with_etags
add_to_config "config.action_dispatch.rack_cache = true"
get "/expires/expires_etag"
- assert_equal "miss, store", last_response.headers["X-Rack-Cache"]
- assert_equal "public", last_response.headers["Cache-Control"]
+ assert_equal "miss, ignore, store", last_response.headers["X-Rack-Cache"]
+ assert_equal "public", last_response.headers["Cache-Control"]
body = last_response.body
etag = last_response.headers["ETag"]
@@ -149,8 +149,8 @@ def test_cache_works_with_last_modified
add_to_config "config.action_dispatch.rack_cache = true"
get "/expires/expires_last_modified"
- assert_equal "miss, store", last_response.headers["X-Rack-Cache"]
- assert_equal "public", last_response.headers["Cache-Control"]
+ assert_equal "miss, ignore, store", last_response.headers["X-Rack-Cache"]
+ assert_equal "public", last_response.headers["Cache-Control"]
body = last_response.body
last = last_response.headers["Last-Modified"]

6 comments on commit dcb05f2

@tenderlove
Ruby on Rails member

What changed that we need this?

@carlosantoniodasilva
Ruby on Rails member

@tenderlove apparently this.

@reed
reed commented on dcb05f2 Jan 15, 2013

Correct. In response to this.

@carlosantoniodasilva
Ruby on Rails member

As a side note, it'd be awesome if we did not rely on cookies for that, though, but I couldn't stop to think of any other way yet.

@reed
reed commented on dcb05f2 Jan 15, 2013

The solution I initially proposed used HTML5 storage, not cookies, but I was overruled. Using a cookie guaranteed we'd catch all edge cases.

@steveklabnik
Ruby on Rails member

😢

Please sign in to comment.
Something went wrong with that request. Please try again.