Add tests for valid factory to all model tests
This commit is contained in:
parent
1a24dd3057
commit
b09f4eceb2
|
|
@ -6,6 +6,9 @@ RSpec.describe GroupScore, type: :model do
|
||||||
describe 'association' do
|
describe 'association' do
|
||||||
it { should belong_to :team }
|
it { should belong_to :team }
|
||||||
it { should belong_to :group }
|
it { should belong_to :group }
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'has a valid factory' do
|
||||||
|
expect(build(:group_score)).to be_valid
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ RSpec.describe Team, type: :model do
|
||||||
it { should belong_to :tournament }
|
it { should belong_to :tournament }
|
||||||
it { should have_many :group_score }
|
it { should have_many :group_score }
|
||||||
it { should have_many :scores }
|
it { should have_many :scores }
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'has a valid factory' do
|
||||||
|
expect(build(:team)).to be_valid
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,8 @@ RSpec.describe Tournament, type: :model do
|
||||||
it { should have_many :teams }
|
it { should have_many :teams }
|
||||||
it { should have_many :stages }
|
it { should have_many :stages }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'has valid factory' do
|
||||||
|
expect(build(:tournament)).to be_valid
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue