Fix for ActionView::Template#refresh in rails 3.1.0.beta

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
André Camargo 2010-10-15 00:11:40 -03:00 committed by José Valim
parent 69789c3b29
commit c42ea2172e
2 changed files with 3 additions and 3 deletions

View File

@ -163,7 +163,7 @@ module ActionView
name = pieces.pop name = pieces.pop
partial = !!name.sub!(/^_/, "") partial = !!name.sub!(/^_/, "")
lookup.disable_cache do lookup.disable_cache do
lookup.find_template(name, pieces.join, partial, @locals) lookup.find_template(name, pieces.join('/'), partial, @locals)
end end
end end

View File

@ -93,9 +93,9 @@ class TestERBTemplate < ActiveSupport::TestCase
end end
def test_refresh_with_templates def test_refresh_with_templates
@template = new_template("Hello", :virtual_path => "test/foo") @template = new_template("Hello", :virtual_path => "test/foo/bar")
@template.locals = [:key] @template.locals = [:key]
@context.lookup_context.expects(:find_template).with("foo", "test", false, [:key]).returns("template") @context.lookup_context.expects(:find_template).with("bar", "test/foo", false, [:key]).returns("template")
assert_equal "template", @template.refresh(@context) assert_equal "template", @template.refresh(@context)
end end