diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-04-02 00:02:11 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-04-02 00:02:11 +0000 |
commit | da6f5a1cb4ccabef8c5ae0cb56495c198844c4f8 (patch) | |
tree | 9fe9d53b953f7307e8d1840ad10b7aa738dd2688 /actionpack/test/template/base_test.rb | |
parent | cf865196fec17d337640b4bca5cb16ca7c67f62f (diff) | |
download | rails-da6f5a1cb4ccabef8c5ae0cb56495c198844c4f8.tar.gz rails-da6f5a1cb4ccabef8c5ae0cb56495c198844c4f8.tar.bz2 rails-da6f5a1cb4ccabef8c5ae0cb56495c198844c4f8.zip |
Change ActionView template defaults. Look for templates using the request format first, such as show.html.erb or show.xml.builder, before looking for the old defaults like show.erb or show.builder [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/base_test.rb')
-rw-r--r-- | actionpack/test/template/base_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/base_test.rb b/actionpack/test/template/base_test.rb index 754c38f393..ec35f82dde 100644 --- a/actionpack/test/template/base_test.rb +++ b/actionpack/test/template/base_test.rb @@ -14,14 +14,22 @@ class ActionViewTemplateTest < Test::Unit::TestCase assert_equal :foo, @template.send(:find_template_extension_for, 'foo') end + def test_should_find_formatted_erb_extension + @template.expects(:delegate_template_exists?).with('foo').returns(nil) + @template.expects(:formatted_template_exists?).with('foo.html').returns("erb") + assert_equal "html.erb", @template.send(:find_template_extension_for, 'foo') + end + def test_should_find_erb_extension @template.expects(:delegate_template_exists?).with('foo').returns(nil) + @template.expects(:formatted_template_exists?).with('foo.html').returns(nil) @template.expects(:erb_template_exists?).with('foo').returns(:erb) assert_equal :erb, @template.send(:find_template_extension_for, 'foo') end def test_should_find_builder_extension @template.expects(:delegate_template_exists?).with('foo').returns(nil) + @template.expects(:formatted_template_exists?).with('foo.html').returns(nil) @template.expects(:erb_template_exists?).with('foo').returns(nil) @template.expects(:builder_template_exists?).with('foo').returns(:builder) assert_equal :builder, @template.send(:find_template_extension_for, 'foo') @@ -29,6 +37,7 @@ class ActionViewTemplateTest < Test::Unit::TestCase def test_should_find_javascript_extension @template.expects(:delegate_template_exists?).with('foo').returns(nil) + @template.expects(:formatted_template_exists?).with('foo.html').returns(nil) @template.expects(:erb_template_exists?).with('foo').returns(nil) @template.expects(:builder_template_exists?).with('foo').returns(nil) @template.expects(:javascript_template_exists?).with('foo').returns(true) |