Merge pull request #40 from turniere/ticket/TURNIERE-189
Use Factory Linting
This commit is contained in:
commit
1690755c4f
|
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'FactoryBot' do
|
||||
it 'has valid factories' do
|
||||
FactoryBot.lint
|
||||
end
|
||||
end
|
||||
|
|
@ -7,8 +7,4 @@ RSpec.describe GroupScore, type: :model 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
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@ RSpec.describe Group, type: :model do
|
|||
it { should have_many :group_scores }
|
||||
end
|
||||
|
||||
it 'has a valid factory' do
|
||||
expect(build(:group)).to be_valid
|
||||
end
|
||||
|
||||
describe '#teams' do
|
||||
before do
|
||||
@group = create(:group, match_count: 1) # this is getting stubbed anyways
|
||||
|
|
|
|||
|
|
@ -7,8 +7,4 @@ RSpec.describe MatchScore, type: :model do
|
|||
it { should belong_to :match }
|
||||
it { should belong_to :team }
|
||||
end
|
||||
|
||||
it 'has a valid factory' do
|
||||
expect(build(:match_score)).to be_valid
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -76,10 +76,4 @@ RSpec.describe Match, type: :model do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'has a valid factory' do
|
||||
expect(build(:match)).to be_valid
|
||||
expect(build(:running_playoff_match)).to be_valid
|
||||
expect(build(:group_match)).to be_valid
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,11 +9,6 @@ RSpec.describe Stage, type: :model do
|
|||
it { should have_many :groups }
|
||||
end
|
||||
|
||||
it 'has a valid factory' do
|
||||
expect(build(:stage)).to be_valid
|
||||
expect(build(:group_stage)).to be_valid
|
||||
end
|
||||
|
||||
describe '#teams' do
|
||||
context 'group stage' do
|
||||
before do
|
||||
|
|
|
|||
|
|
@ -12,9 +12,4 @@ RSpec.describe Team, type: :model do
|
|||
it { should have_many :group_scores }
|
||||
it { should have_many :match_scores }
|
||||
end
|
||||
|
||||
it 'has a valid factory' do
|
||||
expect(build(:team)).to be_valid
|
||||
expect(build(:detached_team)).to be_valid
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -30,10 +30,4 @@ 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
|
||||
expect(build(:stage_tournament)).to be_valid
|
||||
expect(build(:group_stage_tournament)).to be_valid
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,8 +12,4 @@ RSpec.describe User, type: :model do
|
|||
it { should validate_presence_of :username }
|
||||
it { should validate_uniqueness_of(:username).case_insensitive }
|
||||
end
|
||||
|
||||
it 'has a valid factory' do
|
||||
expect(build(:user)).to be_valid
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue