aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/new_base/render_template_test.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-05-20 21:15:06 +0200
committerPratik Naik <pratiknaik@gmail.com>2009-05-20 21:15:06 +0200
commitc03b0ca7eb7e73587005e1440bf90cd01ed10aa5 (patch)
tree508196be70cad42b4debce6103fb5f5e2b3c5cbe /actionpack/test/new_base/render_template_test.rb
parent6761759a90c08b9db8d5720a8ee4c4329a547caf (diff)
downloadrails-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/render_template_test.rb')
-rw-r--r--actionpack/test/new_base/render_template_test.rb87
1 files changed, 43 insertions, 44 deletions
diff --git a/actionpack/test/new_base/render_template_test.rb b/actionpack/test/new_base/render_template_test.rb
index 6c50ae4203..face5b7571 100644
--- a/actionpack/test/new_base/render_template_test.rb
+++ b/actionpack/test/new_base/render_template_test.rb
@@ -79,7 +79,6 @@ module RenderTemplate
end
class WithLayoutController < ::ApplicationController
-
self.view_paths = [ActionView::Template::FixturePath.new(
"test/basic.html.erb" => "Hello from basic.html.erb",
"shared.html.erb" => "Elastica",
@@ -108,46 +107,45 @@ module RenderTemplate
end
end
- class TestTemplateRenderWithLayout < SimpleRouteCase
- describe "rendering a normal template with full path with layout"
-
- get "/render_template/with_layout"
- assert_body "Hello from basic.html.erb, I'm here!"
- assert_status 200
- end
-
- class TestTemplateRenderWithLayoutTrue < SimpleRouteCase
- describe "rendering a normal template with full path with layout => :true"
-
- get "/render_template/with_layout/with_layout"
- assert_body "Hello from basic.html.erb, I'm here!"
- assert_status 200
- end
-
- class TestTemplateRenderWithLayoutFalse < SimpleRouteCase
- describe "rendering a normal template with full path with layout => :false"
-
- get "/render_template/with_layout/with_layout_false"
- assert_body "Hello from basic.html.erb"
- assert_status 200
- end
-
- class TestTemplateRenderWithLayoutNil < SimpleRouteCase
- describe "rendering a normal template with full path with layout => :nil"
-
- get "/render_template/with_layout/with_layout_nil"
- assert_body "Hello from basic.html.erb"
- assert_status 200
- end
-
- class TestTemplateRenderWithCustomLayout < SimpleRouteCase
- describe "rendering a normal template with full path with layout => 'greetings'"
-
- get "/render_template/with_layout/with_custom_layout"
- assert_body "Hello from basic.html.erb, I wish thee well."
- assert_status 200
+ class TestWithLayout < SimpleRouteCase
+ describe "Rendering with :template using implicit or explicit layout"
+
+ test "rendering with implicit layout" do
+ get "/render_template/with_layout"
+
+ assert_body "Hello from basic.html.erb, I'm here!"
+ assert_status 200
+ end
+
+ test "rendering with layout => :true" do
+ get "/render_template/with_layout/with_layout"
+
+ assert_body "Hello from basic.html.erb, I'm here!"
+ assert_status 200
+ end
+
+ test "rendering with layout => :false" do
+ get "/render_template/with_layout/with_layout_false"
+
+ assert_body "Hello from basic.html.erb"
+ assert_status 200
+ end
+
+ test "rendering with layout => :nil" do
+ get "/render_template/with_layout/with_layout_nil"
+
+ assert_body "Hello from basic.html.erb"
+ assert_status 200
+ end
+
+ test "rendering layout => 'greetings'" do
+ get "/render_template/with_layout/with_custom_layout"
+
+ assert_body "Hello from basic.html.erb, I wish thee well."
+ assert_status 200
+ end
end
-
+
module Compatibility
class WithoutLayoutController < ActionController::Base
self.view_paths = [ActionView::Template::FixturePath.new(
@@ -161,11 +159,12 @@ module RenderTemplate
end
class TestTemplateRenderWithForwardSlash < SimpleRouteCase
- describe "rendering a normal template with full path starting with a leading slash"
+ test "rendering a normal template with full path starting with a leading slash" do
+ get "/render_template/compatibility/without_layout/with_forward_slash"
- get "/render_template/compatibility/without_layout/with_forward_slash"
- assert_body "Hello from basic.html.erb"
- assert_status 200
+ assert_body "Hello from basic.html.erb"
+ assert_status 200
+ end
end
end
end \ No newline at end of file