aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/abstract
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/abstract')
-rw-r--r--actionpack/test/abstract/render_test.rb34
-rw-r--r--actionpack/test/abstract/translation_test.rb26
2 files changed, 60 insertions, 0 deletions
diff --git a/actionpack/test/abstract/render_test.rb b/actionpack/test/abstract/render_test.rb
index be0478b638..ffd430fa86 100644
--- a/actionpack/test/abstract/render_test.rb
+++ b/actionpack/test/abstract/render_test.rb
@@ -6,9 +6,16 @@ module AbstractController
class ControllerRenderer < AbstractController::Base
include AbstractController::Rendering
+ def _prefix
+ "renderer"
+ end
+
self.view_paths = [ActionView::FixtureResolver.new(
"default.erb" => "With Default",
"template.erb" => "With Template",
+ "renderer/string.erb" => "With String",
+ "renderer/symbol.erb" => "With Symbol",
+ "string/with_path.erb" => "With String With Path",
"some/file.erb" => "With File",
"template_name.erb" => "With Template Name"
)]
@@ -33,6 +40,18 @@ module AbstractController
render
end
+ def string
+ render "string"
+ end
+
+ def string_with_path
+ render "string/with_path"
+ end
+
+ def symbol
+ render :symbol
+ end
+
def template_name
render :_template_name => :template_name
end
@@ -73,6 +92,21 @@ module AbstractController
assert_equal "With Default", @controller.response_body
end
+ def test_render_string
+ @controller.process(:string)
+ assert_equal "With String", @controller.response_body
+ end
+
+ def test_render_symbol
+ @controller.process(:symbol)
+ assert_equal "With Symbol", @controller.response_body
+ end
+
+ def test_render_string_with_path
+ @controller.process(:string_with_path)
+ assert_equal "With String With Path", @controller.response_body
+ end
+
def test_render_template_name
@controller.process(:template_name)
assert_equal "With Template Name", @controller.response_body
diff --git a/actionpack/test/abstract/translation_test.rb b/actionpack/test/abstract/translation_test.rb
new file mode 100644
index 0000000000..0bf61a6556
--- /dev/null
+++ b/actionpack/test/abstract/translation_test.rb
@@ -0,0 +1,26 @@
+require 'abstract_unit'
+
+# class TranslatingController < ActionController::Base
+# end
+
+class TranslationControllerTest < Test::Unit::TestCase
+ def setup
+ @controller = ActionController::Base.new
+ end
+
+ def test_action_controller_base_responds_to_translate
+ assert @controller.respond_to?(:translate)
+ end
+
+ def test_action_controller_base_responds_to_t
+ assert @controller.respond_to?(:t)
+ end
+
+ def test_action_controller_base_responds_to_localize
+ assert @controller.respond_to?(:localize)
+ end
+
+ def test_action_controller_base_responds_to_l
+ assert @controller.respond_to?(:l)
+ end
+end \ No newline at end of file