title: Using Webmock to fake successful ActiveMerchant response
body: <p>I'm using ActiveMerchant to integrate with Authorize.net CIM.  I'm in the middle of writing up automated tests, and I've begun putting into place Webmock calls so that my tests aren't actually hitting Authorize.net each time that they run.</p>
  
  <p>I've created XML files from the responses of raw request data, and for the most part, it's working well.  However, when I mock up a successful response, ActiveMerchant for some reason still tells me that Response.success? is not true.</p>
  
  <p>My function</p>
  
  <pre><code>if self.cim_customer_profile_id.nil?
    ActiveMerchant::Billing::Base.mode = :test
  
    customer_profile_information = {
      :profile     =&gt; {
        :merchant_customer_id =&gt; self.customer.username.first(20),
        :email =&gt; self.customer.email
      }
    }
  
    gateway = ActiveMerchant::Billing::AuthorizeNetCimGateway.new(
      :login    =&gt; AUTHORIZE_NET_API_LOGIN_ID,
      :password =&gt; AUTHORIZE_NET_API_TRANSACTION_KEY
    )
  
    response = gateway.create_customer_profile(customer_profile_information)
  
    if response.success?
      self.cim_customer_profile_id = response.authorization
    else
      raise StandardError, response.message
    end
  end
  </code></pre>
  
  <p>And then my stubbed response is:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Content-Type: text/xml; charset=utf-8
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;createCustomerProfileResponse xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'&gt;
    &lt;messages&gt;
      &lt;resultCode&gt;
        Ok
      &lt;/resultCode&gt;
      &lt;message&gt;
        &lt;code&gt;
          I00001
        &lt;/code&gt;
        &lt;text&gt;
          Successful.
        &lt;/text&gt;
      &lt;/message&gt;
    &lt;/messages&gt;
    &lt;customerProfileId&gt;10793616&lt;/customerProfileId&gt;
    &lt;customerPaymentProfileIdList/&gt;
    &lt;customerShippingAddressIdList/&gt;
    &lt;validationDirectResponseList/&gt;
  &lt;/createCustomerProfileResponse&gt;
  </code></pre>
  
  <p>Is there any reason why ActiveMerchant won't function with a successful, stubbed, request?  Or am I missing something that ActiveMerchant requires in order to register that the response is actually successful?</p>