2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2021-02-20 09:57:27 -08:00
|
|
|
# == Schema Information
|
|
|
|
|
#
|
|
|
|
|
# Table name: ticket_purchases
|
|
|
|
|
#
|
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
|
# amount_paid :float default(0.0)
|
|
|
|
|
# paid :boolean default(FALSE)
|
|
|
|
|
# quantity :integer default(1)
|
|
|
|
|
# week :integer
|
|
|
|
|
# created_at :datetime
|
|
|
|
|
# conference_id :integer
|
|
|
|
|
# payment_id :integer
|
|
|
|
|
# ticket_id :integer
|
|
|
|
|
# user_id :integer
|
|
|
|
|
#
|
2018-09-03 20:44:39 +02:00
|
|
|
FactoryBot.define do
|
2014-08-28 15:21:05 +02:00
|
|
|
factory :ticket_purchase do
|
|
|
|
|
user
|
|
|
|
|
conference
|
|
|
|
|
ticket
|
2018-09-08 03:58:50 +02:00
|
|
|
quantity { 10 }
|
2017-06-08 03:45:08 +05:30
|
|
|
factory :paid_ticket_purchase do
|
|
|
|
|
after(:build) do |ticket_purchase|
|
|
|
|
|
payment = create(:payment)
|
|
|
|
|
ticket_purchase.pay(payment)
|
|
|
|
|
end
|
|
|
|
|
end
|
2014-08-28 15:21:05 +02:00
|
|
|
end
|
|
|
|
|
end
|