diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-24 15:18:29 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-24 15:18:29 -0700 |
commit | c25cf09c13f245e89a043b3312f3d6a335276354 (patch) | |
tree | 83c2c91ec0fa381d8b21d402468d1bdad7cc0fa1 /railties | |
parent | c4c5918b688da1ca00be34e3c66fcc5ca78500b1 (diff) | |
download | rails-c25cf09c13f245e89a043b3312f3d6a335276354.tar.gz rails-c25cf09c13f245e89a043b3312f3d6a335276354.tar.bz2 rails-c25cf09c13f245e89a043b3312f3d6a335276354.zip |
override `controller_class` on the request
Just like the other places. We need to refactor this because the code
is almost identical to that in the action pack tests
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/path_generation_test.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/railties/test/path_generation_test.rb b/railties/test/path_generation_test.rb index 27e64b97b7..a16adc72a6 100644 --- a/railties/test/path_generation_test.rb +++ b/railties/test/path_generation_test.rb @@ -11,26 +11,26 @@ class PathGenerationTest < ActiveSupport::TestCase super() end - class Dispatcher < ActionDispatch::Routing::RouteSet::Dispatcher - def initialize(defaults, set, block) - super(defaults) + class Request < DelegateClass(ActionDispatch::Request) + def initialize(target, url_helpers, block) + super(target) + @url_helpers = url_helpers @block = block - @set = set end - def controller_reference(controller_param) + def controller_class + url_helpers = @url_helpers block = @block - set = @set Class.new(ActionController::Base) { - include set.url_helpers + include url_helpers define_method(:process) { |name| block.call(self) } def to_a; [200, {}, []]; end } end end - def dispatcher defaults - TestSet::Dispatcher.new defaults, self, @block + def make_request(env) + Request.new super, self.url_helpers, @block end end |