Rails 2.2.2

Updated to Rails 2.2.2.
Added a couple more Ruby 1.9 fixes, but that's pretty much at a standstill,
until one gets Maruku and HTML5lib working right under Ruby 1.9.
This commit is contained in:
Jacques Distler 2008-11-24 15:53:39 -06:00
parent 1b69b148de
commit 2e81ca2d30
716 changed files with 8009 additions and 113047 deletions

View file

@ -8,7 +8,9 @@ class ViewRenderTest < Test::Unit::TestCase
end
def test_render_file
assert_equal "Hello world!", @view.render("test/hello_world.erb")
assert_deprecated do
assert_equal "Hello world!", @view.render("test/hello_world.erb")
end
end
def test_render_file_not_using_full_path
@ -16,11 +18,15 @@ class ViewRenderTest < Test::Unit::TestCase
end
def test_render_file_without_specific_extension
assert_equal "Hello world!", @view.render("test/hello_world")
assert_deprecated do
assert_equal "Hello world!", @view.render("test/hello_world")
end
end
def test_render_file_at_top_level
assert_equal 'Elastica', @view.render('/shared')
assert_deprecated do
assert_equal 'Elastica', @view.render('/shared')
end
end
def test_render_file_with_full_path
@ -29,16 +35,28 @@ class ViewRenderTest < Test::Unit::TestCase
end
def test_render_file_with_instance_variables
assert_equal "The secret is in the sauce\n", @view.render("test/render_file_with_ivar.erb")
assert_deprecated do
assert_equal "The secret is in the sauce\n", @view.render("test/render_file_with_ivar.erb")
end
end
def test_render_file_with_locals
locals = { :secret => 'in the sauce' }
assert_equal "The secret is in the sauce\n", @view.render("test/render_file_with_locals.erb", locals)
assert_deprecated do
assert_equal "The secret is in the sauce\n", @view.render("test/render_file_with_locals.erb", locals)
end
end
def test_render_file_not_using_full_path_with_dot_in_path
assert_equal "The secret is in the sauce\n", @view.render("test/dot.directory/render_file_with_ivar")
assert_deprecated do
assert_equal "The secret is in the sauce\n", @view.render("test/dot.directory/render_file_with_ivar")
end
end
def test_render_has_access_current_template
assert_deprecated do
assert_equal "test/template.erb", @view.render("test/template.erb")
end
end
def test_render_update
@ -111,6 +129,10 @@ class ViewRenderTest < Test::Unit::TestCase
assert_nil @view.render(:partial => "test/customer", :collection => nil)
end
def test_render_partial_with_nil_values_in_collection
assert_equal "Hello: davidHello: Anonymous", @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), nil ])
end
def test_render_partial_with_empty_array_should_return_nil
assert_nil @view.render(:partial => [])
end
@ -158,4 +180,14 @@ class ViewRenderTest < Test::Unit::TestCase
ActionView::Template.register_template_handler :foo, CustomHandler
assert_equal 'source: "Hello, <%= name %>!"', @view.render(:inline => "Hello, <%= name %>!", :locals => { :name => "Josh" }, :type => :foo)
end
def test_render_with_layout
assert_equal %(<title></title>\nHello world!\n),
@view.render(:file => "test/hello_world.erb", :layout => "layouts/yield")
end
def test_render_with_nested_layout
assert_equal %(<title>title</title>\n<div id="column">column</div>\n<div id="content">content</div>\n),
@view.render(:file => "test/nested_layout.erb", :layout => "layouts/yield")
end
end