diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-07 23:43:12 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-07 23:43:12 -0700 |
commit | b7529ed1cc7cfd8df5fd1b069e2881d39d3d984c (patch) | |
tree | ef69ba48ba47e42981101aab20aebae1d111c684 /actionpack/test/controller | |
parent | e43d1c226d09afe49b25f5e3a351c4c10371933a (diff) | |
download | rails-b7529ed1cc7cfd8df5fd1b069e2881d39d3d984c.tar.gz rails-b7529ed1cc7cfd8df5fd1b069e2881d39d3d984c.tar.bz2 rails-b7529ed1cc7cfd8df5fd1b069e2881d39d3d984c.zip |
Simplifying usage of ETags and Last-Modified and conditional GET requests
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 76832f5713..fd042794fa 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -15,9 +15,14 @@ class TestController < ActionController::Base end def conditional_hello - etag! [:foo, 123] - last_modified! Time.now.utc.beginning_of_day - render :action => 'hello_world' unless performed? + response.last_modified = Time.now.utc.beginning_of_day + response.etag = [:foo, 123] + + if request.fresh?(response) + head :not_modified + else + render :action => 'hello_world' + end end def render_hello_world |