diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-16 15:16:45 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-16 15:28:27 -0700 |
commit | 5f94b93279f6d0682fafb237c301302c107a9552 (patch) | |
tree | b98a166df8dd74c123be6bcb3a555ec777f24f1d /actionpack/test/controller | |
parent | bfc432574d0b141fd7fe759edfe9b6771dd306bd (diff) | |
download | rails-5f94b93279f6d0682fafb237c301302c107a9552.tar.gz rails-5f94b93279f6d0682fafb237c301302c107a9552.tar.bz2 rails-5f94b93279f6d0682fafb237c301302c107a9552.zip |
Properly escape glob characters.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index ce4b407c7d..6bcd606bf4 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -405,6 +405,14 @@ class TestController < ActionController::Base render :template => "test/hello_world" end + def render_with_explicit_unescaped_template + render :template => "test/h*llo_world" + end + + def render_with_explicit_escaped_template + render :template => "test/hello_w*rld" + end + def render_with_explicit_string_template render "test/hello_world" end @@ -1057,6 +1065,12 @@ class RenderTest < ActionController::TestCase assert_response :success end + def test_render_with_explicit_unescaped_template + assert_raise(ActionView::MissingTemplate) { get :render_with_explicit_unescaped_template } + get :render_with_explicit_escaped_template + assert_equal "Hello w*rld!", @response.body + end + def test_render_with_explicit_string_template get :render_with_explicit_string_template assert_equal "<html>Hello world!</html>", @response.body |