Merge pull request #40 from turniere/ticket/TURNIERE-189

Use Factory Linting
This commit is contained in:
Thor77 2019-05-15 09:51:08 +02:00 committed by GitHub
commit 1690755c4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 9 additions and 38 deletions

View File

@ -0,0 +1,9 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'FactoryBot' do
it 'has valid factories' do
FactoryBot.lint
end
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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