From b09f4eceb2c2512baa25a2df40b21eb46bf96f02 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Sat, 17 Nov 2018 18:25:57 +0100 Subject: [PATCH] Add tests for valid factory to all model tests --- spec/models/group_score_spec.rb | 3 +++ spec/models/team_spec.rb | 3 +++ spec/models/tournament_spec.rb | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/spec/models/group_score_spec.rb b/spec/models/group_score_spec.rb index bb3b409..8056e32 100644 --- a/spec/models/group_score_spec.rb +++ b/spec/models/group_score_spec.rb @@ -6,6 +6,9 @@ RSpec.describe GroupScore, type: :model do describe 'association' do it { should belong_to :team } it { should belong_to :group } + end + it 'has a valid factory' do + expect(build(:group_score)).to be_valid end end diff --git a/spec/models/team_spec.rb b/spec/models/team_spec.rb index 7b5dc01..c4be2b3 100644 --- a/spec/models/team_spec.rb +++ b/spec/models/team_spec.rb @@ -11,6 +11,9 @@ RSpec.describe Team, type: :model do it { should belong_to :tournament } it { should have_many :group_score } it { should have_many :scores } + end + it 'has a valid factory' do + expect(build(:team)).to be_valid end end diff --git a/spec/models/tournament_spec.rb b/spec/models/tournament_spec.rb index 5948b90..5182e11 100644 --- a/spec/models/tournament_spec.rb +++ b/spec/models/tournament_spec.rb @@ -29,4 +29,8 @@ RSpec.describe Tournament, type: :model do it { should have_many :teams } it { should have_many :stages } end + + it 'has valid factory' do + expect(build(:tournament)).to be_valid + end end