File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FactoryBot . define do
2+ factory :match do
3+ association :organization
4+ match_type { %w[ official scrim tournament ] . sample }
5+ game_start { Faker ::Time . between ( from : 30 . days . ago , to : Time . current ) }
6+ game_end { game_start + rand ( 1200 ..2400 ) . seconds }
7+ game_duration { ( game_end - game_start ) . to_i }
8+ victory { [ true , false ] . sample }
9+ patch_version { "13.#{ rand ( 1 ..24 ) } .1" }
10+ opponent_name { Faker ::Esport . team }
11+ our_side { %w[ blue red ] . sample }
12+ our_score { rand ( 5 ..30 ) }
13+ opponent_score { rand ( 5 ..30 ) }
14+ end
15+ end
Original file line number Diff line number Diff line change 1+ FactoryBot . define do
2+ factory :organization do
3+ name { Faker ::Esport . team }
4+ slug { name . parameterize }
5+ region { %w[ BR NA EUW KR ] . sample }
6+ tier { %w[ amateur semi_pro professional ] . sample }
7+ primary_color { Faker ::Color . hex_color }
8+ secondary_color { Faker ::Color . hex_color }
9+ logo_url { Faker ::Internet . url }
10+ website_url { Faker ::Internet . url }
11+ end
12+ end
Original file line number Diff line number Diff line change 1+ FactoryBot . define do
2+ factory :player do
3+ association :organization
4+ summoner_name { Faker ::Esport . player }
5+ real_name { Faker ::Name . name }
6+ role { %w[ top jungle mid adc support ] . sample }
7+ status { 'active' }
8+ jersey_number { rand ( 1 ..99 ) }
9+ birth_date { Faker ::Date . birthday ( min_age : 18 , max_age : 30 ) }
10+ country { 'BR' }
11+ nationality { 'Brazilian' }
12+ solo_queue_tier { %w[ DIAMOND MASTER GRANDMASTER CHALLENGER ] . sample }
13+ solo_queue_rank { %w[ I II III IV ] . sample }
14+ solo_queue_lp { rand ( 0 ..100 ) }
15+ solo_queue_wins { rand ( 50 ..500 ) }
16+ solo_queue_losses { rand ( 50 ..500 ) }
17+ end
18+ end
Original file line number Diff line number Diff line change 1+ FactoryBot . define do
2+ factory :user do
3+ association :organization
4+ email { Faker ::Internet . email }
5+ password { 'password123' }
6+ password_confirmation { 'password123' }
7+ first_name { Faker ::Name . first_name }
8+ last_name { Faker ::Name . last_name }
9+ role { 'analyst' }
10+ status { 'active' }
11+
12+ trait :owner do
13+ role { 'owner' }
14+ end
15+
16+ trait :admin do
17+ role { 'admin' }
18+ end
19+
20+ trait :coach do
21+ role { 'coach' }
22+ end
23+
24+ trait :analyst do
25+ role { 'analyst' }
26+ end
27+
28+ trait :viewer do
29+ role { 'viewer' }
30+ end
31+ end
32+ end
You can’t perform that action at this time.
0 commit comments