test/abstract_dispatcher.rb in dougbarth-actionwebservice-2.1.1 vs test/abstract_dispatcher.rb in dougbarth-actionwebservice-2.3.3
- old
+ new
@@ -356,11 +356,11 @@
service_name = service_name(controller)
request = protocol.encode_action_pack_request(service_name, 'broken, method, name!', 'broken request body', :request_class => ActionController::TestRequest)
response = ActionController::TestResponse.new
controller.process(request, response)
# puts response.body
- assert(response.headers['Status'] =~ /^500/)
+ assert(response.status =~ /^500/)
end
send_garbage_request.call
controller.class.web_service_exception_reporting = false
send_garbage_request.call
end
@@ -536,10 +536,11 @@
return_value
end
def http_method_allowed?(method)
method = method.to_s.upcase
- test_request = ActionController::TestRequest.new({ 'action' => 'api' })
+ test_request = ActionController::TestRequest.new
+ test_request.action = 'api'
test_response = ActionController::TestResponse.new
test_request.env['REQUEST_METHOD'] = method
result = @direct_controller.process(test_request, test_response)
result.body =~ /(GET|POST|PUT|DELETE|TRACE|CONNECT) not supported/ ? false : true
end