Created
May 30, 2010 20:08
-
-
Save windock/419286 to your computer and use it in GitHub Desktop.
Revisions
-
windock created this gist
May 30, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ require 'spec_helper' include ActiveMerchant::Billing describe BillingTransaction do describe "remote requests" do before :each do @response = mock("response") @response.stub!(:success?).and_return true @response.stub!(:authorization).and_return "some reference" @gateway = mock("gateway") @billing_transaction = BillingTransaction.new @billing_transaction.gateway = @gateway end describe ".puchase" do before do @gateway.stub!(:purchase).and_return @response end it "should take processor response as message" do @response.stub!(:message).and_return "I'm a gateway response" @billing_transaction.purchase!(100, Factory.build(:credit_card)) @billing_transaction.message.should == "I'm a gateway response" end end describe ".credit" do before do @gateway.stub!(:credit).and_return @response end it "should take processor response as message" do @response.stub!(:message).and_return "I'm a gateway response" @billing_transaction.credit!(100, Factory.build(:credit_card)) @billing_transaction.message.should == "I'm a gateway response" end end end end