aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_base/etag_test.rb
diff options
context:
space:
mode:
authorRajinder Yadav <devguy.ca@gmail.com>2010-10-15 22:19:39 -0400
committerRajinder Yadav <devguy.ca@gmail.com>2010-10-15 22:19:39 -0400
commit62eb00a62e3868c3500372def52968b919332b51 (patch)
tree8497f517402c19eae1fea22943565cbf11496ef7 /actionpack/test/controller/new_base/etag_test.rb
parent018bf0f5756ef3887815ea46d6671dc1d3b526cf (diff)
parentcffae06a4f1b7aac86a7e99cfb244890f837f976 (diff)
downloadrails-62eb00a62e3868c3500372def52968b919332b51.tar.gz
rails-62eb00a62e3868c3500372def52968b919332b51.tar.bz2
rails-62eb00a62e3868c3500372def52968b919332b51.zip
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'actionpack/test/controller/new_base/etag_test.rb')
-rw-r--r--actionpack/test/controller/new_base/etag_test.rb46
1 files changed, 0 insertions, 46 deletions
diff --git a/actionpack/test/controller/new_base/etag_test.rb b/actionpack/test/controller/new_base/etag_test.rb
deleted file mode 100644
index 2bca5aec6a..0000000000
--- a/actionpack/test/controller/new_base/etag_test.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'abstract_unit'
-
-module Etags
- class BasicController < ActionController::Base
- self.view_paths = [ActionView::FixtureResolver.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 => "etags"
- end
- end
-
- class EtagTest < Rack::TestCase
- 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