Permalink
Browse files

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

  • Loading branch information...
1 parent 7cef8ad commit 2aefff8f76f75654720a245cc430beb8c3b4cde2 @spastorino spastorino committed Jul 9, 2011
Showing with 5 additions and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/base.rb
  2. +4 −0 actionpack/test/template/test_case_test.rb
@@ -194,7 +194,7 @@ def assign(new_assigns) # :nodoc:
end
def initialize(context = nil, assigns = {}, controller = nil, formats = nil) #:nodoc:
- @_config = {}
+ @_config = ActiveSupport::InheritableOptions.new
# Handle all these for backwards compatibility.
# TODO Provide a new API for AV::Base and deprecate this one.
@@ -45,6 +45,10 @@ class GeneralViewTest < ActionView::TestCase
assert_same _view, view
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
assert_equal 'Eloy', render('developers/developer', :developer => stub(:name => 'Eloy'))
end

0 comments on commit 2aefff8

Please sign in to comment.