diff options
author | Aaron Patterson <tenderlove@github.com> | 2018-09-25 09:27:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-25 09:27:37 -0700 |
commit | 6d698fdb070f4134c1795e8befb4e4c5e29a682f (patch) | |
tree | ccbaae1d82da6abfc99e151752a557a99da83dfc /actionview/test/template/erb/helper.rb | |
parent | 4f12139a22f70ff0abc1709b8888011f8bfee42c (diff) | |
parent | 3301804ff6abcd5aae06cc5acbb82bc6a472f008 (diff) | |
download | rails-6d698fdb070f4134c1795e8befb4e4c5e29a682f.tar.gz rails-6d698fdb070f4134c1795e8befb4e4c5e29a682f.tar.bz2 rails-6d698fdb070f4134c1795e8befb4e4c5e29a682f.zip |
Merge pull request #33973 from rails/remove-catch-all
Remove deprecated catch-all route in the AV tests
Diffstat (limited to 'actionview/test/template/erb/helper.rb')
-rw-r--r-- | actionview/test/template/erb/helper.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/actionview/test/template/erb/helper.rb b/actionview/test/template/erb/helper.rb index 57d6cb1be3..2d31b19be8 100644 --- a/actionview/test/template/erb/helper.rb +++ b/actionview/test/template/erb/helper.rb @@ -3,7 +3,6 @@ module ERBTest class ViewContext include ActionView::Helpers::UrlHelper - include SharedTestRoutes.url_helpers include ActionView::Helpers::TagHelper include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::FormHelper @@ -14,9 +13,15 @@ module ERBTest end class BlockTestCase < ActiveSupport::TestCase - def render_content(start, inside) + def render_content(start, inside, routes = nil) + routes ||= ActionDispatch::Routing::RouteSet.new.tap do |rs| + rs.draw {} + end + context = Class.new(ViewContext) { + include routes.url_helpers + }.new template = block_helper(start, inside) - ActionView::Template::Handlers::ERB.erb_implementation.new(template).evaluate(ViewContext.new) + ActionView::Template::Handlers::ERB.erb_implementation.new(template).evaluate(context) end def block_helper(str, rest) |