diff options
author | Akira Matsuda <ronnie@dio.jp> | 2015-02-06 00:18:05 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2015-02-06 01:46:59 +0900 |
commit | da9038eaa5d19c77c734a044c6b35d7bfac01104 (patch) | |
tree | eaf9110c8d5dce1ad019b4038760eba67ed67185 /actionview/test/template | |
parent | 4ca1dda0bfc9ba76c5da114ab47399a385ab059e (diff) | |
download | rails-da9038eaa5d19c77c734a044c6b35d7bfac01104.tar.gz rails-da9038eaa5d19c77c734a044c6b35d7bfac01104.tar.bz2 rails-da9038eaa5d19c77c734a044c6b35d7bfac01104.zip |
Partial template name does no more have to be a valid Ruby identifier
because the partial renderer would not create an lvar per each template since c67005f221f102fe2caca231027d9b11cf630484
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/render_test.rb | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index 66667e0474..f77b81f0ee 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -171,18 +171,12 @@ module RenderTestCases assert_equal "only partial", @view.render("test/partial_only", :counter_counter => 5) end - def test_render_partial_with_invalid_name - e = assert_raises(ArgumentError) { @view.render(:partial => "test/200") } - assert_equal "The partial name (test/200) is not a valid Ruby identifier; " + - "make sure your partial name starts with underscore, " + - "and is followed by any combination of letters, numbers and underscores.", e.message + def test_render_partial_with_number + assert_nothing_raised { @view.render(:partial => "test/200") } end def test_render_partial_with_missing_filename - e = assert_raises(ArgumentError) { @view.render(:partial => "test/") } - assert_equal "The partial name (test/) is not a valid Ruby identifier; " + - "make sure your partial name starts with underscore, " + - "and is followed by any combination of letters, numbers and underscores.", e.message + assert_raises(ActionView::MissingTemplate) { @view.render(:partial => "test/") } end def test_render_partial_with_incompatible_object @@ -190,11 +184,12 @@ module RenderTestCases assert_equal "'#{nil.inspect}' is not an ActiveModel-compatible object. It must implement :to_partial_path.", e.message end + def test_render_partial_starting_with_a_capital + assert_nothing_raised { @view.render(:partial => 'test/FooBar') } + end + def test_render_partial_with_hyphen - e = assert_raises(ArgumentError) { @view.render(:partial => "test/a-in") } - assert_equal "The partial name (test/a-in) is not a valid Ruby identifier; " + - "make sure your partial name starts with underscore, " + - "and is followed by any combination of letters, numbers and underscores.", e.message + assert_nothing_raised { @view.render(:partial => "test/a-in") } end def test_render_partial_with_invalid_option_as |