diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-11-22 05:01:07 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-11-22 05:01:07 +0000 |
commit | 155eb47cf3a815306c5c9b6fcd254b838fc26b5c (patch) | |
tree | 43e90b9c2d0e7d805c7f42ccb9dd760e9654ef65 /actionpack/test | |
parent | 9afbf875ebd038da003a6ebb8d2540955616f549 (diff) | |
download | rails-155eb47cf3a815306c5c9b6fcd254b838fc26b5c.tar.gz rails-155eb47cf3a815306c5c9b6fcd254b838fc26b5c.tar.bz2 rails-155eb47cf3a815306c5c9b6fcd254b838fc26b5c.zip |
Tests and fix for extension extraction. References #10130 [tarmo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/action_view_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/actionpack/test/action_view_test.rb b/actionpack/test/action_view_test.rb new file mode 100644 index 0000000000..729438af32 --- /dev/null +++ b/actionpack/test/action_view_test.rb @@ -0,0 +1,26 @@ +require File.dirname(__FILE__) + '/abstract_unit' +require 'test/unit' + +class ActionViewTests < Test::Unit::TestCase + def test_find_template_extension_from_first_render + base = ActionView::Base.new + + assert_nil base.send(:find_template_extension_from_first_render) + + { + nil => nil, + '' => nil, + 'foo' => nil, + '/foo' => nil, + 'foo.rb' => 'rb', + 'foo.bar.rb' => 'bar.rb', + 'baz/foo.rb' => 'rb', + 'baz/foo.bar.rb' => 'bar.rb', + 'baz/foo.o/foo.rb' => 'rb', + 'baz/foo.o/foo.bar.rb' => 'bar.rb', + }.each do |input,expectation| + base.instance_variable_set('@first_render', input) + assert_equal expectation, base.send(:find_template_extension_from_first_render) + end + end +end |