From 13d76b6170886493369f94693e61364044e4316a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 15 Jan 2010 17:55:08 +0100 Subject: Add some implicit path tests to Subscriber. --- actionpack/test/template/subscriber_test.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'actionpack/test/template/subscriber_test.rb') diff --git a/actionpack/test/template/subscriber_test.rb b/actionpack/test/template/subscriber_test.rb index d64637f141..af0b3102cf 100644 --- a/actionpack/test/template/subscriber_test.rb +++ b/actionpack/test/template/subscriber_test.rb @@ -55,6 +55,15 @@ module ActionViewSubscriberTest assert_match /Rendered test\/_customer.erb/, @logger.logged(:info).last end + def test_render_partial_with_implicit_path + @view.stubs(:controller_path).returns("test") + @view.render(Customer.new("david"), :greeting => "hi") + wait + + assert_equal 1, @logger.logged(:info).size + assert_match /Rendered customers\/_customer\.html\.erb/, @logger.logged(:info).last + end + def test_render_collection_template @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), Customer.new("mary") ]) wait @@ -63,6 +72,15 @@ module ActionViewSubscriberTest assert_match /Rendered test\/_customer.erb/, @logger.logged(:info).last end + def test_render_collection_with_implicit_path + @view.stubs(:controller_path).returns("test") + @view.render([ Customer.new("david"), Customer.new("mary") ], :greeting => "hi") + wait + + assert_equal 1, @logger.logged(:info).size + assert_match /Rendered customers\/_customer\.html\.erb/, @logger.logged(:info).last + end + def test_render_collection_template_without_path @view.stubs(:controller_path).returns("test") @view.render([ GoodCustomer.new("david"), Customer.new("mary") ], :greeting => "hi") @@ -72,7 +90,6 @@ module ActionViewSubscriberTest assert_match /Rendered collection/, @logger.logged(:info).last end - class SyncSubscriberTest < ActiveSupport::TestCase include Rails::Subscriber::SyncTestHelper include ActionViewSubscriberTest -- cgit v1.2.3