aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/test
diff options
context:
space:
mode:
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