Skip to content

Instantly share code, notes, and snippets.

describe Order do
let(:product){stub(:product)}
let(:payment_gateway){stub(:payment_gateway)}
let(:order){Order.new(payment_gateway)}
it "confirm the order if the client has funds" do
product.stub(:price).and_return(50)
payment_gateway.stub(:user_has_funds).with(50).and_return(true)
order.buy(product).should be_true
end