title: Rails API functional tests with XML body
body: <p>I've written functional tests for API endpoints built in Rails using shoulda testing framework.</p>
  
  <p>An example looks like the following:</p>
  
  <pre><code>  setup do
      authenticated_xml_request('xml-file-name')
      post :new
    end
  
    should respond_with :success
  </code></pre>
  
  <p><strong>authenticated_xml_request</strong> is a test helper method that sets
  <strong>@request.env['RAW_POST_DATA']</strong> with XML content.</p>
  
  <p>After upgrading the app from <strong>rails 2.3.3</strong> to <strong>rails 2.3.8</strong>, the functional tests are failing because the XML content received is not merged in the params hash.</p>
  
  <p>I'm setting the request with the correct mime type via <strong>@request.accept =
  "text/xml"</strong></p>
  
  <p>I'm able to inspect the content of the request using <strong>request.raw_post</strong> but i'd like to keep the current setup working.</p>
  
  <p>Also, running a test from the terminal using cURL or any other library (rest_http) in development mode, the API works perfectly well.</p>
  
  <p>Any tips or help is much appreciated.</p>