diff options
| author | Jon Leighton <j@jonathanleighton.com> | 2010-10-06 12:11:38 +0100 |
|---|---|---|
| committer | Jon Leighton <j@jonathanleighton.com> | 2010-10-06 12:11:38 +0100 |
| commit | c954d54e2f36bb53ced5e3655adc071dd233797e (patch) | |
| tree | d84bf4bf51f65a1c817089c6fe37c3e9f20420d0 /actionpack/test/controller/new_base | |
| parent | f2b41914d6be935182d37e0c0d491352ac3de043 (diff) | |
| parent | d40ca9cce241a8083756c993d6c99a79e62e050e (diff) | |
| download | rails-c954d54e2f36bb53ced5e3655adc071dd233797e.tar.gz rails-c954d54e2f36bb53ced5e3655adc071dd233797e.tar.bz2 rails-c954d54e2f36bb53ced5e3655adc071dd233797e.zip | |
Merge branch 'master' into nested_has_many_through
Diffstat (limited to 'actionpack/test/controller/new_base')
| -rw-r--r-- | actionpack/test/controller/new_base/etag_test.rb | 46 |
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 |
