Sha256: 93089b5ba901dbd3a6dac14785bc704ceff858271d77415cbc3fd08959132289

Contents?: true

Size: 1.19 KB

Versions: 20

Compression:

Stored size: 1.19 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper.rb'

describe Order do
  before(:each) do
    @order = Order.new
    @order.creditcard = (@creditcard = Creditcard.new)
    @order.checkout_complete = true
    add_stubs(@order, :save => true)
  end
  
# COMMENTED OUT UNTIL WE FINISH REFACTORING THE CC PAYMENT STUFF  
=begin
  describe "capture" do
    it "should capture the creditcard_payment" do
      @order.state = 'authorized'
      @creditcard_payment.should_receive(:capture)
      @order.capture
    end
  end

  describe "cancel" do    
    before(:each) { OrderMailer.stub!(:deliver_cancel).with(any_args) }
    
    %w{authorized captured}.each do |state|
      describe "from #{state} state" do
        it "should cancel the creditcard_payment" do
          @order.state = state
          @inventory_unit.stub!(:state).and_return('sold')
          @creditcard_payment.should_receive(:void)
          @order.cancel
        end
      end
    end
  end

  describe "return" do
    it "should cancel the creditcard_payment" do
      @order.state = 'shipped'
      @inventory_unit.stub!(:state).and_return('shipped')
      @creditcard_payment.should_receive(:void)
      @order.return
    end
  end
=end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
spree-0.11.0 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.10.2 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.10.1 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.10.0 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.10.0.beta vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-enriquez-0.9.4 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.9.4 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.9.3 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.9.2 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.9.1 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.9.0 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.8.4 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.8.5 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.6.0 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.7.0 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.7.1 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.8.0 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.8.1 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.8.2 vendor/extensions/payment_gateway/spec/models/order_spec.rb
spree-0.8.3 vendor/extensions/payment_gateway/spec/models/order_spec.rb