aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/test
diff options
context:
space:
mode:
authorLeon Breedt <bitserf@gmail.com>2005-04-28 17:55:34 +0000
committerLeon Breedt <bitserf@gmail.com>2005-04-28 17:55:34 +0000
commit8694a79bb2d543a46867454b743c38ce85380e4e (patch)
treeb6bd7b711773f0305b9368521ebb20821d696143 /actionwebservice/test
parent896fea505b67f6dd842a58c72bcd919c593d925a (diff)
downloadrails-8694a79bb2d543a46867454b743c38ce85380e4e.tar.gz
rails-8694a79bb2d543a46867454b743c38ce85380e4e.tar.bz2
rails-8694a79bb2d543a46867454b743c38ce85380e4e.zip
default to using UTF-8 as response encoding for SOAP if none is
supplied, but if an encoding is supplied by caller, use that for the response instead (NAKAMURA Hiroshi) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1245 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test')
-rw-r--r--actionwebservice/test/abstract_dispatcher.rb8
-rw-r--r--actionwebservice/test/dispatcher_action_controller_soap_test.rb9
2 files changed, 17 insertions, 0 deletions
diff --git a/actionwebservice/test/abstract_dispatcher.rb b/actionwebservice/test/abstract_dispatcher.rb
index 0fe7525c48..70ad04d745 100644
--- a/actionwebservice/test/abstract_dispatcher.rb
+++ b/actionwebservice/test/abstract_dispatcher.rb
@@ -379,6 +379,12 @@ module DispatcherCommonTests
raise NotImplementedError
end
+ def update_request(ap_request)
+ end
+
+ def check_response(ap_response)
+ end
+
def do_method_call(container, public_method_name, *params)
request_env = {}
mode = container.web_service_dispatching_mode
@@ -416,9 +422,11 @@ module DispatcherCommonTests
# puts body
ap_request = @protocol.encode_action_pack_request(service_name, public_method_name, body, :request_class => ActionController::TestRequest)
ap_request.env.update(request_env)
+ update_request(ap_request)
ap_response = ActionController::TestResponse.new
container.process(ap_request, ap_response)
# puts ap_response.body
+ check_response(ap_response)
public_method_name, return_value = @protocol.decode_response(ap_response.body)
unless is_exception?(return_value) || virtual
return_value = method.cast_returns(return_value)
diff --git a/actionwebservice/test/dispatcher_action_controller_soap_test.rb b/actionwebservice/test/dispatcher_action_controller_soap_test.rb
index 731185f398..4451c23f3c 100644
--- a/actionwebservice/test/dispatcher_action_controller_soap_test.rb
+++ b/actionwebservice/test/dispatcher_action_controller_soap_test.rb
@@ -68,6 +68,15 @@ class TC_DispatcherActionControllerSoap < Test::Unit::TestCase
end
protected
+ def update_request(ap_request)
+ ap_request.env.update('HTTP_CONTENT_TYPE' => 'text/xml; charset=us-ascii')
+ end
+
+ def check_response(ap_response)
+ assert_equal 'text/xml; charset=us-ascii', ap_response.headers['Content-Type']
+ assert_match /xml.*?encoding="us-ascii"/, ap_response.body
+ end
+
def exception_message(soap_fault_exception)
soap_fault_exception.detail.cause.message
end