提交 d9182c0a 编写于 作者: S Santiago Pastorino

config should always be an AS::InheritableOptions object. Closes #1992

上级 ea4b94a7
...@@ -194,7 +194,7 @@ def assign(new_assigns) # :nodoc: ...@@ -194,7 +194,7 @@ def assign(new_assigns) # :nodoc:
end end
def initialize(context = nil, assigns = {}, controller = nil, formats = nil) #:nodoc: def initialize(context = nil, assigns = {}, controller = nil, formats = nil) #:nodoc:
@_config = {} @_config = ActiveSupport::InheritableOptions.new
# Handle all these for backwards compatibility. # Handle all these for backwards compatibility.
# TODO Provide a new API for AV::Base and deprecate this one. # TODO Provide a new API for AV::Base and deprecate this one.
......
...@@ -45,6 +45,10 @@ class GeneralViewTest < ActionView::TestCase ...@@ -45,6 +45,10 @@ class GeneralViewTest < ActionView::TestCase
assert_same _view, view assert_same _view, view
end end
test "retrieve non existing config values" do
assert_equal nil, ActionView::Base.new.config.something_odd
end
test "works without testing a helper module" do test "works without testing a helper module" do
assert_equal 'Eloy', render('developers/developer', :developer => stub(:name => 'Eloy')) assert_equal 'Eloy', render('developers/developer', :developer => stub(:name => 'Eloy'))
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册