diff options
author | wycats <wycats@gmail.com> | 2010-04-03 02:30:06 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-04-03 02:44:02 -0700 |
commit | 3eb97531b8650db5cc7b9558cc3828c56a526b6a (patch) | |
tree | 70f28e707c552b3be295fff52ab387e901698825 /actionpack/test/abstract_unit.rb | |
parent | 13004d4f849682772060371273fda3312dd3b884 (diff) | |
download | rails-3eb97531b8650db5cc7b9558cc3828c56a526b6a.tar.gz rails-3eb97531b8650db5cc7b9558cc3828c56a526b6a.tar.bz2 rails-3eb97531b8650db5cc7b9558cc3828c56a526b6a.zip |
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)
Diffstat (limited to 'actionpack/test/abstract_unit.rb')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 143491a640..fe78b8ec1f 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -57,6 +57,18 @@ module RackTestUtils extend self end +module RenderERBUtils + def render_erb(string) + template = ActionView::Template.new( + string.strip, + "test template", + ActionView::Template::Handlers::ERB, + {}) + + template.render(self, {}).strip + end +end + module SetupOnce extend ActiveSupport::Concern @@ -225,6 +237,14 @@ class Rack::TestCase < ActionController::IntegrationTest end end +class ActionController::Base + def self.test_routes(&block) + router = ActionDispatch::Routing::RouteSet.new + router.draw(&block) + include router.url_helpers + end +end + class ::ApplicationController < ActionController::Base end |