diff --git a/spec/factorybot_lint_spec.rb b/spec/factorybot_lint_spec.rb new file mode 100644 index 0000000..1639768 --- /dev/null +++ b/spec/factorybot_lint_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'FactoryBot' do + it 'has valid factories' do + FactoryBot.lint + end +end diff --git a/spec/models/group_score_spec.rb b/spec/models/group_score_spec.rb index 8056e32..1a995eb 100644 --- a/spec/models/group_score_spec.rb +++ b/spec/models/group_score_spec.rb @@ -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 diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index e8c8be2..99ae876 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -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 diff --git a/spec/models/match_score_spec.rb b/spec/models/match_score_spec.rb index a48734f..b6f7bfc 100644 --- a/spec/models/match_score_spec.rb +++ b/spec/models/match_score_spec.rb @@ -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 diff --git a/spec/models/match_spec.rb b/spec/models/match_spec.rb index 01d34c5..5acec23 100644 --- a/spec/models/match_spec.rb +++ b/spec/models/match_spec.rb @@ -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 diff --git a/spec/models/stage_spec.rb b/spec/models/stage_spec.rb index a14fccd..ac1dc72 100644 --- a/spec/models/stage_spec.rb +++ b/spec/models/stage_spec.rb @@ -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 diff --git a/spec/models/team_spec.rb b/spec/models/team_spec.rb index d1e477b..c2f25e3 100644 --- a/spec/models/team_spec.rb +++ b/spec/models/team_spec.rb @@ -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 diff --git a/spec/models/tournament_spec.rb b/spec/models/tournament_spec.rb index c437df8..20e6f6b 100644 --- a/spec/models/tournament_spec.rb +++ b/spec/models/tournament_spec.rb @@ -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 diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index c3ee007..7216b64 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -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