Sha256: 93b9f147e73fdd0f5be570c389acb1756138029cef6bf158ff5140013b0d06d8

Contents?: true

Size: 784 Bytes

Versions: 10

Compression:

Stored size: 784 Bytes

Contents

FactoryGirl.define do
  sequence :datetime do |n|
    DateTime.now + 7.days + n.minutes
  end

  factory :show do
    datetime { FactoryGirl.generate :datetime }
    organization
    event
    association :chart, :factory => :assigned_chart
  end

  factory :show_with_tickets, :parent => :show do
    after(:create) do |show|
      show.build!
      show.publish!
    end
  end

  factory :settleable_show, :parent => :show_with_tickets do
    association :organization, :factory => :organization_with_bank_account
    after(:create) do |show|
      show.tickets.each do |ticket|
        ticket.sell_to(FactoryGirl.create(:individual))
        Item.for(ticket).save
      end
    end
  end

  factory :expired_show, :parent => :show do
    datetime { DateTime.now - 1.day}
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
artfully_ose-1.2.0 spec/factories/show_factories.rb
artfully_ose-1.2.0.beta.1 spec/factories/show_factories.rb
artfully_ose-1.2.0.alpha.2 spec/factories/show_factories.rb
artfully_ose-1.2.0.alpha.1 spec/factories/show_factories.rb
artfully_ose-1.2.0.pre.27 spec/factories/show_factories.rb
artfully_ose-1.2.0.pre.26 spec/factories/show_factories.rb
artfully_ose-1.2.0.pre.24 spec/factories/show_factories.rb
artfully_ose-1.2.0.pre.23 spec/factories/show_factories.rb
artfully_ose-1.2.0.pre.21 spec/factories/show_factories.rb
artfully_ose-1.2.0.pre.20 spec/factories/show_factories.rb