From a99ae0e2488edc849407ecdc12f94ea93ec8805c Mon Sep 17 00:00:00 2001 From: Thor77 Date: Wed, 3 Apr 2019 10:03:45 +0200 Subject: [PATCH] Assert tournament/stage/group relations optional --- spec/models/match_spec.rb | 4 ++-- spec/models/team_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/match_spec.rb b/spec/models/match_spec.rb index 74fc582..ad31ac6 100644 --- a/spec/models/match_spec.rb +++ b/spec/models/match_spec.rb @@ -5,8 +5,8 @@ require 'rails_helper' RSpec.describe Match, type: :model do context 'association' do it { should have_many :match_scores } - it { should belong_to :stage } - it { should belong_to :group } + it { should belong_to(:stage).optional } + it { should belong_to(:group).optional } end context '#new' do diff --git a/spec/models/team_spec.rb b/spec/models/team_spec.rb index b930c5c..ce229fa 100644 --- a/spec/models/team_spec.rb +++ b/spec/models/team_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Team, type: :model do end describe 'association' do - it { should belong_to :tournament } + it { should belong_to(:tournament).optional } it { should have_many :group_scores } it { should have_many :match_scores } end