diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2016-08-10 09:57:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-10 09:57:07 -0700 |
commit | 79e27b909ea983a4bec6d246ad23e77c5a2e47f4 (patch) | |
tree | 23160166668ec587f049ad9cb2a4c35f331e9e89 /actionpack/test/abstract_unit.rb | |
parent | dfb246118afbc6b59f6517eaed00208aa6c7e4b5 (diff) | |
parent | 496d744fa31665de810b404de968ba86ed87c319 (diff) | |
download | rails-79e27b909ea983a4bec6d246ad23e77c5a2e47f4.tar.gz rails-79e27b909ea983a4bec6d246ad23e77c5a2e47f4.tar.bz2 rails-79e27b909ea983a4bec6d246ad23e77c5a2e47f4.zip |
Merge pull request #26092 from kerrizor/kerrizor/force-param-encoding
Allow specifying encoding of parameters by action
Diffstat (limited to 'actionpack/test/abstract_unit.rb')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 0c77de3c16..7bff21b5a2 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -122,27 +122,19 @@ class ActionDispatch::IntegrationTest < ActiveSupport::TestCase # Stub Rails dispatcher so it does not get controller references and # simply return the controller#action as Rack::Body. class NullController < ::ActionController::Metal - def initialize(controller_name) - @controller = controller_name - end - - def make_response!(request) - self.class.make_response! request - end - - def dispatch(action, req, res) - [200, {"Content-Type" => "text/html"}, ["#{@controller}##{action}"]] + def self.dispatch(action, req, res) + [200, {"Content-Type" => "text/html"}, ["#{req.params[:controller]}##{action}"]] end end - class NullControllerRequest < DelegateClass(ActionDispatch::Request) + class NullControllerRequest < ActionDispatch::Request def controller_class - NullController.new params[:controller] + NullController end end def make_request(env) - NullControllerRequest.new super + NullControllerRequest.new env end end |