diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-15 17:55:08 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-15 23:36:03 +0100 |
commit | 13d76b6170886493369f94693e61364044e4316a (patch) | |
tree | 21c62ab191ee8d9e2aedf2e3321c9588aae15b21 /actionpack | |
parent | b2578a148cb78b4f238ad92864c9d9e509e5e451 (diff) | |
download | rails-13d76b6170886493369f94693e61364044e4316a.tar.gz rails-13d76b6170886493369f94693e61364044e4316a.tar.bz2 rails-13d76b6170886493369f94693e61364044e4316a.zip |
Add some implicit path tests to Subscriber.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/template/subscriber_test.rb | 19 |
1 files changed, 18 insertions, 1 deletions
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 |