Add tests for valid factory to all model tests

This commit is contained in:
Thor77 2018-11-17 18:25:57 +01:00
parent 1a24dd3057
commit b09f4eceb2
No known key found for this signature in database
GPG Key ID: 5051E71B46AA669A
3 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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