|
1 | | -FactoryBot.define do |
2 | | - factory :vod_review do |
3 | | - association :organization |
4 | | - association :reviewer, factory: :user |
5 | | - association :match, factory: :match |
6 | | - |
7 | | - title { Faker::Lorem.sentence(word_count: 3) } |
8 | | - description { Faker::Lorem.paragraph } |
9 | | - review_type { %w[team individual opponent].sample } |
10 | | - review_date { Faker::Time.between(from: 30.days.ago, to: Time.current) } |
11 | | - video_url { "https://www.youtube.com/watch?v=#{Faker::Alphanumeric.alpha(number: 11)}" } |
12 | | - thumbnail_url { Faker::Internet.url } |
13 | | - duration { rand(1800..3600) } |
14 | | - status { 'draft' } |
15 | | - is_public { false } |
16 | | - tags { %w[scrim review analysis].sample(2) } |
17 | | - |
18 | | - trait :published do |
19 | | - status { 'published' } |
20 | | - end |
21 | | - |
22 | | - trait :archived do |
23 | | - status { 'archived' } |
24 | | - end |
25 | | - |
26 | | - trait :public do |
27 | | - is_public { true } |
28 | | - share_link { SecureRandom.urlsafe_base64(16) } |
29 | | - end |
30 | | - |
31 | | - trait :with_timestamps do |
32 | | - after(:create) do |vod_review| |
33 | | - create_list(:vod_timestamp, 3, vod_review: vod_review) |
34 | | - end |
35 | | - end |
36 | | - end |
37 | | -end |
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +FactoryBot.define do |
| 4 | + factory :vod_review do |
| 5 | + association :organization |
| 6 | + association :reviewer, factory: :user |
| 7 | + association :match, factory: :match |
| 8 | + |
| 9 | + title { Faker::Lorem.sentence(word_count: 3) } |
| 10 | + description { Faker::Lorem.paragraph } |
| 11 | + review_type { %w[team individual opponent].sample } |
| 12 | + review_date { Faker::Time.between(from: 30.days.ago, to: Time.current) } |
| 13 | + video_url { "https://www.youtube.com/watch?v=#{Faker::Alphanumeric.alpha(number: 11)}" } |
| 14 | + thumbnail_url { Faker::Internet.url } |
| 15 | + duration { rand(1800..3600) } |
| 16 | + status { 'draft' } |
| 17 | + is_public { false } |
| 18 | + tags { %w[scrim review analysis].sample(2) } |
| 19 | + |
| 20 | + trait :published do |
| 21 | + status { 'published' } |
| 22 | + end |
| 23 | + |
| 24 | + trait :archived do |
| 25 | + status { 'archived' } |
| 26 | + end |
| 27 | + |
| 28 | + trait :public do |
| 29 | + is_public { true } |
| 30 | + share_link { SecureRandom.urlsafe_base64(16) } |
| 31 | + end |
| 32 | + |
| 33 | + trait :with_timestamps do |
| 34 | + after(:create) do |vod_review| |
| 35 | + create_list(:vod_timestamp, 3, vod_review: vod_review) |
| 36 | + end |
| 37 | + end |
| 38 | + end |
| 39 | +end |
0 commit comments