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
:type => card_type,
:number => card_number,
:verification_value => card_verification,
:month => card_expires_on.blank? ? Time.now.month :
:year => card_expires_on.blank? ? Time.now.year :
:first_name => first_name,
:last_name => last_name
This method should return valid if the card is valid.
I started out like this 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!