Sha256: bb2bb326b4df82be6a8045cb1a9468fa4518ebbeb1f8db87e396a86a5ff3c697

Contents?: true

Size: 1.02 KB

Versions: 25

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

# Attributes
describe 'Factories' do
  let(:factories) { [:user, :customer, :subscription, :address, :product, :cart, :order_item, :order, :purchased_order, :declined_order, :cart_with_subscription, :order_with_subscription] }

  before { StripeMock.start }
  after { StripeMock.stop }

  it 'should have all valid factories' do
    factories.each do |factory|
      obj = FactoryGirl.create(factory)

      puts "Invalid factory #{factory}: #{obj.errors.inspect}" unless obj.valid?

      obj.valid?.should eq true
    end
  end

  it 'should have created an Order with a billing_address and shipping_address' do
    order = FactoryGirl.create(:order)

    order.billing_address.present?.should eq true
    order.shipping_address.present?.should eq true

    order.billing_address.valid?.should eq true
    order.shipping_address.valid?.should eq true

    order.billing_address.full_name.present?.should eq true
    order.shipping_address.full_name.present?.should eq true

    order.save.should eq true
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
effective_orders-3.0.0 spec/models/factories_spec.rb
effective_orders-2.2.4 spec/models/factories_spec.rb
effective_orders-2.2.3 spec/models/factories_spec.rb
effective_orders-2.2.2 spec/models/factories_spec.rb
effective_orders-2.2.1 spec/models/factories_spec.rb
effective_orders-2.2.0 spec/models/factories_spec.rb
effective_orders-2.1.17 spec/models/factories_spec.rb
effective_orders-2.1.16 spec/models/factories_spec.rb
effective_orders-2.1.15 spec/models/factories_spec.rb
effective_orders-2.1.14 spec/models/factories_spec.rb
effective_orders-2.1.13 spec/models/factories_spec.rb
effective_orders-2.1.12 spec/models/factories_spec.rb
effective_orders-2.1.10 spec/models/factories_spec.rb
effective_orders-2.1.9 spec/models/factories_spec.rb
effective_orders-2.1.8 spec/models/factories_spec.rb
effective_orders-2.1.7 spec/models/factories_spec.rb
effective_orders-2.1.6 spec/models/factories_spec.rb
effective_orders-2.1.5 spec/models/factories_spec.rb
effective_orders-2.1.4 spec/models/factories_spec.rb
effective_orders-2.1.3 spec/models/factories_spec.rb