mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
fix Haml template_test for Rails 1.2.6, 2.0.3 and post-2.1.0
Signed-off-by: Nathan Weizenbaum <nex342@gmail.com>
This commit is contained in:
parent
c2781c7b4e
commit
a0764dfebe
1 changed files with 10 additions and 2 deletions
|
@ -25,8 +25,16 @@ class TemplateTest < Test::Unit::TestCase
|
|||
filters nuke_outer_whitespace nuke_inner_whitespace }
|
||||
|
||||
def setup
|
||||
@base = ActionView::Base.new([], {'article' => Article.new, 'foo' => 'value one'})
|
||||
@base.finder.append_view_path(TEMPLATE_PATH)
|
||||
vars = { 'article' => Article.new, 'foo' => 'value one' }
|
||||
|
||||
unless ActionView::Base.instance_methods.include? 'finder'
|
||||
@base = ActionView::Base.new(TEMPLATE_PATH, vars)
|
||||
else
|
||||
# Rails 2.1.0
|
||||
@base = ActionView::Base.new([], vars)
|
||||
@base.finder.append_view_path(TEMPLATE_PATH)
|
||||
end
|
||||
|
||||
@base.send(:evaluate_assigns)
|
||||
|
||||
# This is used by form_for.
|
||||
|
|
Loading…
Reference in a new issue