As per my previous comment, although you've fixed part of the original, it would also be great to use the credit_card factory method to generate the ActiveMerchant::Billing::CreditCard objects, most other active merchant tests do and is the preferred way to do things. It allows your test to be focus on the bits you care about testing, without being heavily coupled to the parts you don't care about.