0
@@ -8,7 +8,7 @@ class ViewRenderTest < Test::Unit::TestCase
0
- assert_equal "Hello world!", @view.render(
"test/hello_world.erb")
0
+ assert_equal "Hello world!", @view.render(
:file => "test/hello_world.erb")
0
def test_render_file_not_using_full_path
0
@@ -16,11 +16,11 @@ class ViewRenderTest < Test::Unit::TestCase
0
def test_render_file_without_specific_extension
0
- assert_equal "Hello world!", @view.render(
"test/hello_world")
0
+ assert_equal "Hello world!", @view.render(
:file => "test/hello_world")
0
def test_render_file_at_top_level
0
- assert_equal 'Elastica', @view.render(
'/shared')
0
+ assert_equal 'Elastica', @view.render(
:file => '/shared')
0
def test_render_file_with_full_path
0
@@ -29,20 +29,20 @@ class ViewRenderTest < Test::Unit::TestCase
0
def test_render_file_with_instance_variables
0
- assert_equal "The secret is in the sauce\n", @view.render(
"test/render_file_with_ivar.erb")
0
+ assert_equal "The secret is in the sauce\n", @view.render(
:file => "test/render_file_with_ivar.erb")
0
def test_render_file_with_locals
0
locals = { :secret => 'in the sauce' }
0
- assert_equal "The secret is in the sauce\n", @view.render(
"test/render_file_with_locals.erb", locals)
0
+ assert_equal "The secret is in the sauce\n", @view.render(
:file => "test/render_file_with_locals.erb", :locals => locals)
0
def test_render_file_not_using_full_path_with_dot_in_path
0
- assert_equal "The secret is in the sauce\n", @view.render(
"test/dot.directory/render_file_with_ivar")
0
+ assert_equal "The secret is in the sauce\n", @view.render(
:file => "test/dot.directory/render_file_with_ivar")
0
def test_render_has_access_current_template
0
- assert_equal "test/template.erb", @view.render(
"test/template.erb")
0
+ assert_equal "test/template.erb", @view.render(
:file => "test/template.erb")
0
@@ -51,6 +51,10 @@ class ViewRenderTest < Test::Unit::TestCase
0
assert_equal 'alert("Hello, World!");', @view.render(:update) { |page| page.alert('Hello, World!') }
0
+ def test_render_partial_from_default
0
+ assert_equal "only partial", @view.render("test/partial_only")
0
def test_render_partial
0
assert_equal "only partial", @view.render(:partial => "test/partial_only")
0
@@ -73,6 +77,10 @@ class ViewRenderTest < Test::Unit::TestCase
0
assert_equal "5", @view.render(:partial => "test/counter", :locals => { :counter_counter => 5 })
0
+ def test_render_partial_with_locals_from_default
0
+ assert_equal "only partial", @view.render("test/partial_only", :counter_counter => 5)
0
def test_render_partial_with_errors
0
@view.render(:partial => "test/raise")
0
flunk "Render did not raise TemplateError"
Nice commit!
Very nice indeed.
nice change
looks like a small typo in docs
line 55 of partials.rb – @buyer should be @account
hah, that breaks a line i wrote just last night to do template (non-partial) based rendering. hopefully i’ll remember to change it later. ;)
Awesome! I always hated being forces to use :locals => {}, even though everything else was clean and named correctly. Now it just feels right.