From 3eb97531b8650db5cc7b9558cc3828c56a526b6a Mon Sep 17 00:00:00 2001 From: wycats Date: Sat, 3 Apr 2010 02:30:06 -0700 Subject: Refactored url_for in AV to have its own instances of the helpers instead of proxying back to the controller. This potentially allows for more standalone usage of AV. It also kicked up a lot of dust in the tests, which were mocking out controllers to get this behavior. By moving it to the view, it made a lot of the tests more standalone (a win) --- actionpack/test/template/erb/helper.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'actionpack/test/template/erb') diff --git a/actionpack/test/template/erb/helper.rb b/actionpack/test/template/erb/helper.rb index 7147178849..799f9e4036 100644 --- a/actionpack/test/template/erb/helper.rb +++ b/actionpack/test/template/erb/helper.rb @@ -1,20 +1,13 @@ module ERBTest class ViewContext - mock_controller = Class.new do - include SharedTestRoutes.url_helpers - end - + include SharedTestRoutes.url_helpers include ActionView::Helpers::TagHelper include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::FormHelper - attr_accessor :output_buffer + attr_accessor :output_buffer, :controller def protect_against_forgery?() false end - - define_method(:controller) do - mock_controller.new - end end class BlockTestCase < ActiveSupport::TestCase -- cgit v1.2.3