Rails 2.3.3.1
Update to latest Rails. A little bit of jiggery-pokery is involved, since they neglected to re-include vendored Rack in this release.
This commit is contained in:
parent
329fafafce
commit
664552ac02
257 changed files with 4346 additions and 1682 deletions
32
vendor/rails/actionpack/test/template/template_test.rb
vendored
Normal file
32
vendor/rails/actionpack/test/template/template_test.rb
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
require 'abstract_unit'
|
||||
|
||||
class TemplateTest < Test::Unit::TestCase
|
||||
def test_template_path_parsing
|
||||
with_options :base_path => nil, :name => 'abc', :locale => nil, :format => 'html', :extension => 'erb' do |t|
|
||||
t.assert_parses_template_path 'abc.en.html.erb', :locale => 'en'
|
||||
t.assert_parses_template_path 'abc.en.plain.html.erb', :locale => 'en', :format => 'plain.html'
|
||||
t.assert_parses_template_path 'abc.html.erb'
|
||||
t.assert_parses_template_path 'abc.plain.html.erb', :format => 'plain.html'
|
||||
t.assert_parses_template_path 'abc.erb', :format => nil
|
||||
t.assert_parses_template_path 'abc.html', :extension => nil
|
||||
|
||||
t.assert_parses_template_path '_abc.html.erb', :name => '_abc'
|
||||
|
||||
t.assert_parses_template_path 'test/abc.html.erb', :base_path => 'test'
|
||||
t.assert_parses_template_path './test/abc.html.erb', :base_path => './test'
|
||||
t.assert_parses_template_path '../test/abc.html.erb', :base_path => '../test'
|
||||
|
||||
t.assert_parses_template_path 'abc', :extension => nil, :format => nil, :name => nil
|
||||
t.assert_parses_template_path 'abc.xxx', :extension => nil, :format => 'xxx', :name => 'abc'
|
||||
t.assert_parses_template_path 'abc.html.xxx', :extension => nil, :format => 'xxx', :name => 'abc'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def assert_parses_template_path(path, parse_results)
|
||||
template = ActionView::Template.new(path, '')
|
||||
parse_results.each_pair do |k, v|
|
||||
assert_block(%Q{Expected template to parse #{k.inspect} from "#{path}" as #{v.inspect}, but got #{template.send(k).inspect}}) { v == template.send(k) }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue