Topic: noob stub/mock (ActiveMerchant)

Hi Group

I'm still waiting for the light to come on with stubbing/mocking and
the syntax for each. I have simple method in my Order class like

 def credit_card
     :type               => card_type,
     :number             => card_number,
     :verification_value => card_verification,
     :month              => card_expires_on.blank? ? :
     :year               => card_expires_on.blank? ? :
     :first_name         => first_name,
     :last_name          => last_name

This method should return valid if the card is valid. … tCard.html

I started out with the code below but then confusion set in. If anyone has the
time to help me understand or write the proper spec for this method I
think it will help me better understand how to stub or mock a 3rd
party item like this. I just watched the peepcode screencast and I've
watched the railscasts. I'm just trying to apply my meager
understanding to my own project now.

it "should validate credit card" do
     gateway = stub('gateway')

I also have a credit card Factory setup, but I'm not sure where or how
I apply this to the stub.

Thanks in advance!