diff options
author | Guo Xiang Tan <tgx_world@hotmail.com> | 2015-05-13 18:28:33 +0800 |
---|---|---|
committer | Guo Xiang Tan <tgx_world@hotmail.com> | 2015-05-30 14:13:57 +0800 |
commit | ca83436d1b3b6cedd1eca2259f65661e69b01909 (patch) | |
tree | 7a25da4004c50ed7b1cd8056dc912aa16ce14c29 /actionview/test/template | |
parent | 109e71d2bb6d2305a091fe7ea96d4f6e9c7cd52d (diff) | |
download | rails-ca83436d1b3b6cedd1eca2259f65661e69b01909.tar.gz rails-ca83436d1b3b6cedd1eca2259f65661e69b01909.tar.bz2 rails-ca83436d1b3b6cedd1eca2259f65661e69b01909.zip |
Remove `assigns` and `assert_template`.
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/test_case_test.rb | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/actionview/test/template/test_case_test.rb b/actionview/test/template/test_case_test.rb index c6cc47fb4f..05c3dc0613 100644 --- a/actionview/test/template/test_case_test.rb +++ b/actionview/test/template/test_case_test.rb @@ -306,64 +306,6 @@ module ActionView end end - class RenderTemplateTest < ActionView::TestCase - test "supports specifying templates with a Regexp" do - controller.controller_path = "fun" - render(:template => "fun/games/hello_world") - assert_template %r{\Afun/games/hello_world\Z} - end - - test "supports specifying partials" do - controller.controller_path = "test" - render(:template => "test/calling_partial_with_layout") - assert_template :partial => "_partial_for_use_in_layout" - end - - test "supports specifying locals (passing)" do - controller.controller_path = "test" - render(:template => "test/calling_partial_with_layout") - assert_template :partial => "_partial_for_use_in_layout", :locals => { :name => "David" } - end - - test "supports specifying locals (failing)" do - controller.controller_path = "test" - render(:template => "test/calling_partial_with_layout") - e = assert_raise ActiveSupport::TestCase::Assertion do - assert_template :partial => "_partial_for_use_in_layout", :locals => { :name => "Somebody Else" } - end - assert_match(/Somebody Else.*David/m, e.message) - end - - test 'supports different locals on the same partial' do - controller.controller_path = "test" - render(:template => "test/render_two_partials") - assert_template partial: '_partial', locals: { 'first' => '1' } - assert_template partial: '_partial', locals: { 'second' => '2' } - end - - test 'raises descriptive error message when template was not rendered' do - controller.controller_path = "test" - render(template: "test/hello_world_with_partial") - e = assert_raise ActiveSupport::TestCase::Assertion do - assert_template partial: 'i_was_never_rendered', locals: { 'did_not' => 'happen' } - end - assert_match "i_was_never_rendered to be rendered but it was not.", e.message - assert_match 'Expected ["/test/partial"] to include "i_was_never_rendered"', e.message - end - - test 'specifying locals works when the partial is inside a directory with underline prefix' do - controller.controller_path = "test" - render(template: 'test/render_partial_inside_directory') - assert_template partial: 'test/_directory/_partial_with_locales', locals: { 'name' => 'Jane' } - end - - test 'specifying locals works when the partial is inside a directory without underline prefix' do - controller.controller_path = "test" - render(template: 'test/render_partial_inside_directory') - assert_template partial: 'test/_directory/partial_with_locales', locals: { 'name' => 'Jane' } - end - end - module AHelperWithInitialize def initialize(*) super |