diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-05-20 21:15:06 +0200 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-05-20 21:15:06 +0200 |
commit | c03b0ca7eb7e73587005e1440bf90cd01ed10aa5 (patch) | |
tree | 508196be70cad42b4debce6103fb5f5e2b3c5cbe /actionpack/test/new_base/etag_test.rb | |
parent | 6761759a90c08b9db8d5720a8ee4c4329a547caf (diff) | |
download | rails-c03b0ca7eb7e73587005e1440bf90cd01ed10aa5.tar.gz rails-c03b0ca7eb7e73587005e1440bf90cd01ed10aa5.tar.bz2 rails-c03b0ca7eb7e73587005e1440bf90cd01ed10aa5.zip |
Replace the class level Rack::Test DSL with the regular integration tests DSL
Diffstat (limited to 'actionpack/test/new_base/etag_test.rb')
-rw-r--r-- | actionpack/test/new_base/etag_test.rb | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/actionpack/test/new_base/etag_test.rb b/actionpack/test/new_base/etag_test.rb index 7af5febfb3..c77636bb64 100644 --- a/actionpack/test/new_base/etag_test.rb +++ b/actionpack/test/new_base/etag_test.rb @@ -1,47 +1,46 @@ require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") module Etags - class BasicController < ActionController::Base - self.view_paths = [ActionView::Template::FixturePath.new( "etags/basic/base.html.erb" => "Hello from without_layout.html.erb", "layouts/etags.html.erb" => "teh <%= yield %> tagz" )] - + def without_layout render :action => "base" end - + def with_layout render :action => "base", :layout => "etag" end - end - - class TestBasic < SimpleRouteCase + + class EtagTest < SimpleRouteCase describe "Rendering without any special etag options returns an etag that is an MD5 hash of its text" - + test "an action without a layout" do get "/etags/basic/without_layout" + body = "Hello from without_layout.html.erb" assert_body body assert_header "Etag", etag_for(body) assert_status 200 end - + test "an action with a layout" do get "/etags/basic/with_layout" + body = "teh Hello from without_layout.html.erb tagz" assert_body body assert_header "Etag", etag_for(body) assert_status 200 end - + + private + def etag_for(text) %("#{Digest::MD5.hexdigest(text)}") end end - - end
\ No newline at end of file |