blob: 13f193e2c5772d41a17b90b6c2087866d9c70f8f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
require File.dirname(__FILE__) + '/abstract_dispatcher'
class TC_DispatcherActionControllerXmlRpc < Test::Unit::TestCase
include DispatcherTest
include DispatcherCommonTests
def setup
@encoder = WS::Encoding::XmlRpcEncoding.new
@marshaler = WS::Marshaling::XmlRpcMarshaler.new
@direct_controller = DirectController.new
@delegated_controller = DelegatedController.new
end
protected
def exception_message(xmlrpc_fault_exception)
xmlrpc_fault_exception.faultString
end
def is_exception?(obj)
obj.is_a?(XMLRPC::FaultException)
end
def create_ap_request(container, body, public_method_name, *args)
test_request = ActionController::TestRequest.new
test_request.request_parameters['action'] = service_name(container)
test_request.env['REQUEST_METHOD'] = "POST"
test_request.env['HTTP_CONTENTTYPE'] = 'text/xml'
test_request.env['RAW_POST_DATA'] = body
test_request
end
def service_name(container)
container.is_a?(DelegatedController) ? 'test_service' : 'api'
end
end
|