aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/abstract/render_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/abstract/render_test.rb')
-rw-r--r--actionpack/test/abstract/render_test.rb43
1 files changed, 41 insertions, 2 deletions
diff --git a/actionpack/test/abstract/render_test.rb b/actionpack/test/abstract/render_test.rb
index ffd430fa86..db924633ca 100644
--- a/actionpack/test/abstract/render_test.rb
+++ b/actionpack/test/abstract/render_test.rb
@@ -11,13 +11,17 @@ module AbstractController
end
self.view_paths = [ActionView::FixtureResolver.new(
- "default.erb" => "With Default",
"template.erb" => "With Template",
+ "renderer/default.erb" => "With Default",
"renderer/string.erb" => "With String",
"renderer/symbol.erb" => "With Symbol",
+ "renderer/template_name.erb" => "With Template Name",
"string/with_path.erb" => "With String With Path",
"some/file.erb" => "With File",
- "template_name.erb" => "With Template Name"
+ "with_format.html.erb" => "With html format",
+ "with_format.xml.erb" => "With xml format",
+ "with_locale.en.erb" => "With en locale",
+ "with_locale.pl.erb" => "With pl locale"
)]
def template
@@ -59,6 +63,22 @@ module AbstractController
def object
render :_template => ActionView::Template::Text.new("With Object")
end
+
+ def with_html_format
+ render :template => "with_format", :format => :html
+ end
+
+ def with_xml_format
+ render :template => "with_format", :format => :xml
+ end
+
+ def with_en_locale
+ render :template => "with_locale"
+ end
+
+ def with_pl_locale
+ render :template => "with_locale", :locale => :pl
+ end
end
class TestRenderer < ActiveSupport::TestCase
@@ -117,6 +137,25 @@ module AbstractController
assert_equal "With Object", @controller.response_body
end
+ def test_render_with_html_format
+ @controller.process(:with_html_format)
+ assert_equal "With html format", @controller.response_body
+ end
+
+ def test_render_with_xml_format
+ @controller.process(:with_xml_format)
+ assert_equal "With xml format", @controller.response_body
+ end
+
+ def test_render_with_en_locale
+ @controller.process(:with_en_locale)
+ assert_equal "With en locale", @controller.response_body
+ end
+
+ def test_render_with_pl_locale
+ @controller.process(:with_pl_locale)
+ assert_equal "With pl locale", @controller.response_body
+ end
end
end
end