mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
⚠️ ActionView::Base instances should be constructed with a lookup context, assignments, and a controller
This commit is contained in:
parent
eaf539e248
commit
e74c81835a
2 changed files with 4 additions and 4 deletions
|
@ -57,14 +57,14 @@ HAML
|
|||
proper_behavior = false
|
||||
|
||||
begin
|
||||
ActionView::Base.new.render(:inline => "<%= flatten('Foo\\nBar') %>")
|
||||
ActionView::Base.new(ActionView::LookupContext.new('')).render(inline: "<%= flatten('Foo\\nBar') %>")
|
||||
rescue NoMethodError, ActionView::Template::Error
|
||||
proper_behavior = true
|
||||
end
|
||||
assert(proper_behavior)
|
||||
|
||||
begin
|
||||
ActionView::Base.new.render(:inline => "<%= concat('foo') %>")
|
||||
ActionView::Base.new(ActionView::LookupContext.new('')).render(inline: "<%= concat('foo') %>")
|
||||
rescue ArgumentError, NameError
|
||||
proper_behavior = true
|
||||
end
|
||||
|
@ -262,7 +262,7 @@ HAML
|
|||
end
|
||||
|
||||
def test_is_haml
|
||||
assert(!ActionView::Base.new.is_haml?)
|
||||
assert(!ActionView::Base.new(ActionView::LookupContext.new('')).is_haml?)
|
||||
assert_equal("true\n", render("= is_haml?"))
|
||||
end
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ HAML
|
|||
end
|
||||
|
||||
def test_is_haml
|
||||
assert(!ActionView::Base.new.is_haml?)
|
||||
assert(!ActionView::Base.new(ActionView::LookupContext.new('')).is_haml?)
|
||||
assert_equal("true\n", render("= is_haml?", :action_view))
|
||||
assert_equal("false", @base.render(:inline => '<%= is_haml? %>'))
|
||||
assert_equal("false\n", render("= render :inline => '<%= is_haml? %>'", :action_view))
|
||||
|
|
Loading…
Add table
Reference in a new issue