diff options
author | wycats <wycats@gmail.com> | 2010-06-08 18:10:27 -0400 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-06-08 18:10:27 -0400 |
commit | df40dbe6f13c6799e972b20dcc1fbf11f0a02c61 (patch) | |
tree | d3daec753c2e55c859c63053d8411306bb11d603 /actionpack/lib/action_view | |
parent | 6ebc7c8ee6de0f3f441a68baa6351416a6ac0a59 (diff) | |
parent | 5c9f27abaabba0d008ccd710ed1af5f6caa4e371 (diff) | |
download | rails-df40dbe6f13c6799e972b20dcc1fbf11f0a02c61.tar.gz rails-df40dbe6f13c6799e972b20dcc1fbf11f0a02c61.tar.bz2 rails-df40dbe6f13c6799e972b20dcc1fbf11f0a02c61.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 4dbbd2eb6a..15d424be74 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -131,12 +131,14 @@ module ActionView end def _view - view = ActionView::Base.new(ActionController::Base.view_paths, _assigns, @controller) - view.singleton_class.send :include, _helpers - view.singleton_class.send :include, @controller._router.url_helpers - view.singleton_class.send :delegate, :alert, :notice, :to => "request.flash" - view.output_buffer = self.output_buffer - view + @_view ||= begin + view = ActionView::Base.new(ActionController::Base.view_paths, _assigns, @controller) + view.singleton_class.send :include, _helpers + view.singleton_class.send :include, @controller._router.url_helpers + view.singleton_class.send :delegate, :alert, :notice, :to => "request.flash" + view.output_buffer = self.output_buffer + view + end end EXCLUDE_IVARS = %w{ |