Skip to content

Instantly share code, notes, and snippets.

@technicalpickles
Forked from bryanl/gist:891486
Created March 28, 2011 22:55
Show Gist options
  • Save technicalpickles/891489 to your computer and use it in GitHub Desktop.
Save technicalpickles/891489 to your computer and use it in GitHub Desktop.
context 'when the claim fails to save' do
let :checkout do
checkout = Checkout::Base.new(:user => user, :offers => {offer.id => 3}, :root_offer_id => offer.id)
Claim.should_receive(:issue).with(offer, checkout, 3).and_return(claim)
claim.should_receive(:save).and_return(false)
checkout
end
it 'should add an error if the claim cannot be saved' do
handle_claim_step = Checkout::Steps::HandleClaimStep.new(checkout)
handle_claim_step.check_holds
handle_claim_step.checkout.errors.length.should == 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment