aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/abstract_unit.rb2
-rw-r--r--actionpack/test/controller/custom_handler_test.rb4
-rw-r--r--actionpack/test/controller/new_render_test.rb22
-rw-r--r--actionpack/test/controller/test_test.rb1
-rw-r--r--actionpack/test/fixtures/test/_person.rhtml2
-rw-r--r--actionpack/test/fixtures/test/potential_conflicts.rhtml4
6 files changed, 26 insertions, 9 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index fae40cd8ac..5c797a4434 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -8,5 +8,5 @@ require 'action_controller'
require 'action_controller/test_process'
ActionController::Base.logger = nil
-ActionController::Base.ignore_missing_templates = true
+ActionController::Base.ignore_missing_templates = false
ActionController::Routing::Routes.reload rescue nil
diff --git a/actionpack/test/controller/custom_handler_test.rb b/actionpack/test/controller/custom_handler_test.rb
index 8939d19166..38e675ffed 100644
--- a/actionpack/test/controller/custom_handler_test.rb
+++ b/actionpack/test/controller/custom_handler_test.rb
@@ -19,7 +19,7 @@ class CustomHandlerTest < Test::Unit::TestCase
end
def test_custom_render
- result = @view.render_template( "foo", "hello <%= one %>", "one" => "two" )
+ result = @view.render_template( "foo", "hello <%= one %>", nil, "one" => "two" )
assert_equal(
[ "hello <%= one %>", { "one" => "two" }, @view ],
result )
@@ -27,7 +27,7 @@ class CustomHandlerTest < Test::Unit::TestCase
def test_unhandled_extension
# uses the ERb handler by default if the extension isn't recognized
- result = @view.render_template( "bar", "hello <%= one %>", "one" => "two" )
+ result = @view.render_template( "bar", "hello <%= one %>", nil, "one" => "two" )
assert_equal "hello two", result
end
end
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 67529a825e..105e5ec06d 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -114,6 +114,11 @@ class NewRenderTestController < ActionController::Base
redirect_to :action => "double_render"
end
+ def rendering_with_conflicting_local_vars
+ @name = "David"
+ render :action => "potential_conflicts"
+ end
+
def rescue_action(e) raise end
private
@@ -236,11 +241,6 @@ class NewRenderTest < Test::Unit::TestCase
assert_equal "<wrapper>\n<html>\n <p>Hello </p>\n<p>This is grand!</p>\n</html>\n</wrapper>\n", @response.body
end
- # def test_partials_list
- # get :partials_list
- # assert_equal "goodbyeHello: davidHello: marygoodbye\n", @response.body
- # end
-
def test_partial_only
get :partial_only
assert_equal "only partial", @response.body
@@ -287,4 +287,14 @@ class NewRenderTest < Test::Unit::TestCase
def test_render_and_redirect
assert_raises(ActionController::DoubleRenderError) { get :render_and_redirect }
end
-end
+
+ def test_rendering_with_conflicting_local_vars
+ get :rendering_with_conflicting_local_vars
+ assert_equal("First: David\nSecond: Stephan\nThird: David\nFourth: David\nFifth: ", @response.body)
+ end
+
+ # def test_partials_list
+ # get :partials_list
+ # assert_equal "goodbyeHello: davidHello: marygoodbye\n", @response.body
+ # end
+end \ No newline at end of file
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb
index 0ebd6bc472..b27f3e9423 100644
--- a/actionpack/test/controller/test_test.rb
+++ b/actionpack/test/controller/test_test.rb
@@ -5,6 +5,7 @@ class TestTest < Test::Unit::TestCase
class TestController < ActionController::Base
def set_flash
flash["test"] = ">#{flash["test"]}<"
+ render :text => 'ignore me'
end
def test_params
diff --git a/actionpack/test/fixtures/test/_person.rhtml b/actionpack/test/fixtures/test/_person.rhtml
new file mode 100644
index 0000000000..b2e5688956
--- /dev/null
+++ b/actionpack/test/fixtures/test/_person.rhtml
@@ -0,0 +1,2 @@
+Second: <%= name %>
+Third: <%= @name %>
diff --git a/actionpack/test/fixtures/test/potential_conflicts.rhtml b/actionpack/test/fixtures/test/potential_conflicts.rhtml
new file mode 100644
index 0000000000..a5e964e359
--- /dev/null
+++ b/actionpack/test/fixtures/test/potential_conflicts.rhtml
@@ -0,0 +1,4 @@
+First: <%= @name %>
+<%= render :partial => "person", :locals => { :name => "Stephan" } -%>
+Fourth: <%= @name %>
+Fifth: <%= name %> \ No newline at end of file