aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@github.com>2019-01-22 09:28:08 -0800
committerGitHub <noreply@github.com>2019-01-22 09:28:08 -0800
commitdb4b77aca147ec3c7376d803fc6ccb14c9195352 (patch)
treee73fa5f4145cf294f983cb752cc49c8985616d48 /actionpack/lib/action_dispatch/testing
parente26f0658da7ff7e9382d6040fe76c087ff1791e4 (diff)
parent0f081611e6746ebbf17ffc13e119b24c9ad7aa73 (diff)
downloadrails-db4b77aca147ec3c7376d803fc6ccb14c9195352.tar.gz
rails-db4b77aca147ec3c7376d803fc6ccb14c9195352.tar.bz2
rails-db4b77aca147ec3c7376d803fc6ccb14c9195352.zip
Merge pull request #34952 from rails/template-stuff
Template Handler Refactoring
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/routing.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb
index af41521c5c..28cde6704e 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb
@@ -160,9 +160,16 @@ module ActionDispatch
@controller.singleton_class.include(_routes.url_helpers)
if @controller.respond_to? :view_context_class
- @controller.view_context_class = Class.new(@controller.view_context_class) do
+ view_context_class = Class.new(@controller.view_context_class) do
include _routes.url_helpers
end
+
+ custom_view_context = Module.new {
+ define_method(:view_context_class) do
+ view_context_class
+ end
+ }
+ @controller.extend(custom_view_context)
end
end
yield @routes