aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/abstract_unit.rb
diff options
context:
space:
mode:
authorKerri Miller <kerrizor@github.com>2016-08-09 10:35:59 -0700
committerKerri Miller <kerrizor@github.com>2016-08-09 15:43:01 -0700
commit496d744fa31665de810b404de968ba86ed87c319 (patch)
tree5845602181062927cd72709facbb7d7eb92f6b42 /actionpack/test/abstract_unit.rb
parent46f511685c91486295a418547bb08c2aa5e49cfc (diff)
downloadrails-496d744fa31665de810b404de968ba86ed87c319.tar.gz
rails-496d744fa31665de810b404de968ba86ed87c319.tar.bz2
rails-496d744fa31665de810b404de968ba86ed87c319.zip
Allow specifying encoding of parameters by action
At GitHub we need to handle parameter encodings that are not UTF-8. This patch allows us to specify encodings per parameter per action.
Diffstat (limited to 'actionpack/test/abstract_unit.rb')
-rw-r--r--actionpack/test/abstract_unit.rb18
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