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

Version Path
kdmny-spree-0.0.1 spec/models/payment_sepc.rb
spree-0.11.0 spec/models/payment_sepc.rb
spree-0.10.2 spec/models/payment_sepc.rb
spree-0.10.1 spec/models/payment_sepc.rb
spree-0.10.0 spec/models/payment_sepc.rb
spree-0.10.0.beta spec/models/payment_sepc.rb
spree-enriquez-0.9.4 spec/models/payment_sepc.rb
spree-0.9.4 spec/models/payment_sepc.rb
spree-0.9.3 spec/models/payment_sepc.rb
spree-0.9.2 spec/models/payment_sepc.rb
spree-0.9.1 spec/models/payment_sepc.rb
spree-0.9.0 spec/models/payment_sepc.rb
spree-0.8.4 spec/models/payment_sepc.rb
spree-0.8.5 spec/models/payment_sepc.rb
spree-0.6.0 spec/models/payment_sepc.rb
spree-0.7.0 spec/models/payment_sepc.rb
spree-0.7.1 spec/models/payment_sepc.rb
spree-0.8.0 spec/models/payment_sepc.rb
spree-0.8.1 spec/models/payment_sepc.rb
spree-0.8.2 spec/models/payment_sepc.rb