Sha256: 6e9d7882aeba3112fa8dd1617c5f7f68ac8dee5a1ef14161606c39f5af7b3d28

Contents?: true

Size: 928 Bytes

Versions: 47

Compression:

Stored size: 928 Bytes

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 { |factory| FactoryGirl.create(factory).valid?.should eq true }
  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

47 entries across 47 versions & 1 rubygems

Version Path
effective_orders-1.3.5 spec/models/factories_spec.rb
effective_orders-1.3.4 spec/models/factories_spec.rb
effective_orders-1.3.3 spec/models/factories_spec.rb
effective_orders-1.3.2 spec/models/factories_spec.rb
effective_orders-1.3.1 spec/models/factories_spec.rb
effective_orders-1.3.0 spec/models/factories_spec.rb
effective_orders-1.2.13 spec/models/factories_spec.rb