diff options
author | Alexey Vakhov <vakhov@gmail.com> | 2012-04-11 11:28:19 +0600 |
---|---|---|
committer | Alexey Vakhov <vakhov@gmail.com> | 2012-05-04 23:31:03 +0400 |
commit | df36c5f7ffd2657e11eea4e407401c9ff2aa0533 (patch) | |
tree | 02b4e4b059ff4491eb7b59e40e8e4358aa5f89d1 /actionpack/test | |
parent | 9ce057d8ccc799eb4844494e3c6ee553969a66d3 (diff) | |
download | rails-df36c5f7ffd2657e11eea4e407401c9ff2aa0533.tar.gz rails-df36c5f7ffd2657e11eea4e407401c9ff2aa0533.tar.bz2 rails-df36c5f7ffd2657e11eea4e407401c9ff2aa0533.zip |
Fix assert_template assertion with :layout option
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/fixtures/test/hello_world_with_partial.html.erb | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index f5f397c9c0..01151b336b 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -76,6 +76,11 @@ class ActionPackAssertionsController < ActionController::Base render "test/hello_world", :layout => "layouts/standard" end + def render_with_layout_and_partial + @variable_for_layout = nil + render "test/hello_world_with_partial", :layout => "layouts/standard" + end + def session_stuffing session['xmas'] = 'turkey' render :text => "ho ho ho" @@ -478,6 +483,11 @@ class AssertTemplateTest < ActionController::TestCase assert_template :layout => "layouts/standard" end + def test_passes_with_layout_and_partial + get :render_with_layout_and_partial + assert_template :layout => "layouts/standard" + end + def test_assert_template_reset_between_requests get :hello_world assert_template 'test/hello_world' diff --git a/actionpack/test/fixtures/test/hello_world_with_partial.html.erb b/actionpack/test/fixtures/test/hello_world_with_partial.html.erb new file mode 100644 index 0000000000..ec31545356 --- /dev/null +++ b/actionpack/test/fixtures/test/hello_world_with_partial.html.erb @@ -0,0 +1,2 @@ +Hello world! +<%= render '/test/partial' %> |