From b7529ed1cc7cfd8df5fd1b069e2881d39d3d984c Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 7 Aug 2008 23:43:12 -0700 Subject: Simplifying usage of ETags and Last-Modified and conditional GET requests --- actionpack/test/controller/render_test.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'actionpack/test/controller') 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 -- cgit v1.2.3