Sha256: d1b6b536bcfc762ba92248393047b623214aa04fd0bc94f69392bc7f0a416a04
Contents?: true
Size: 831 Bytes
Versions: 21
Compression:
Stored size: 831 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper.rb' describe Payment do before(:each) do @order = Order.new @order.checkout_complete = true @order.stub!(:total).and_return(100) @payment = CreditcardPayment.new(:order => @order) end describe "save hook" do it "should mark order as paid if payment_total = total" do @order.stub!(:payment_total).and_return(100) @order.should_receive(:pay!) @payment.save end it "should mark order as paid if payment_total > total" do @order.stub!(:payment_total).and_return(101) @order.should_receive(:pay!) @payment.save end it "should not mark order as paid if payment_total < total" do @order.stub!(:payment_total).and_return(99) @order.should_not_receive(:pay!) @payment.save end end end
Version data entries
21 entries across 21 versions & 3 rubygems