Merge pull request #20 from turniere/feature/db_testdata

Save Matches and Stages
This commit is contained in:
Daniel Schädler 2018-12-11 16:39:28 +01:00 committed by GitHub
commit 6b7aecaed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,7 @@ tournament = user.tournaments.create! name: Faker::Dog.name
@teams = [] @teams = []
16.times do 16.times do
team = tournament.teams.create name: Faker::HarryPotter.character team = tournament.teams.create! name: Faker::HarryPotter.character
@teams << team @teams << team
end end
4.times do |i| 4.times do |i|
@ -20,5 +20,7 @@ end
match.match_scores.create! team: @teams.sample, points: rand(10) match.match_scores.create! team: @teams.sample, points: rand(10)
match.position = j match.position = j
match.state = rand(7) match.state = rand(7)
match.save!
end end
stage.save!
end end