forked from seanpdoyle/select-your-own-seat
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
factories.rb
45 lines (36 loc) · 763 Bytes
/
factories.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FactoryBot.define do
factory :benedum_center, class: "Venue" do
name { "Benedum Center" }
slug { "benedum_center" }
end
factory :floor do
association :venue, factory: [:benedum_center]
factory :balcony do
name { "Balcony" }
slug { "balcony" }
end
factory :orchestra do
name { "Orchestra" }
slug { "orchestra" }
end
end
factory :section do
association :floor, factory: [:orchestra]
name { "Section #{id}" }
slug { "section-#{id}" }
price { 10_00 }
end
factory :cart do
end
factory :seat do
association :section
sequence(:number)
row { "AA" }
x { 0 }
y { 0 }
end
factory :seat_selection do
association(:cart)
association(:seat)
end
end