Add and apply FactoryBot/RedundantFactoryOption rule

This rule was added in rubocop-factory_bot 2.23.0.
This commit is contained in:
Javi Martín
2023-09-08 13:39:24 +02:00
parent 3b2484af77
commit b88a01f641
7 changed files with 10 additions and 7 deletions

View File

@@ -41,6 +41,9 @@ FactoryBot/FactoryAssociationWithStrategy:
FactoryBot/FactoryClassName:
Enabled: true
FactoryBot/RedundantFactoryOption:
Enabled: true
Layout/ArgumentAlignment:
Enabled: true

View File

@@ -41,7 +41,7 @@ FactoryBot.define do
factory :banner_section, class: "Banner::Section" do
association :banner_id, factory: :banner
association :web_section, factory: :web_section
association :web_section
end
factory :site_customization_page, class: "SiteCustomization::Page" do

View File

@@ -251,7 +251,7 @@ FactoryBot.define do
end
factory :budget_ballot, class: "Budget::Ballot" do
association :user, factory: :user
association :user
budget
transient { investments { [] } }

View File

@@ -47,6 +47,6 @@ FactoryBot.define do
factory :flag do
association :flaggable, factory: :debate
association :user, factory: :user
association :user
end
end

View File

@@ -2,7 +2,7 @@ FactoryBot.define do
factory :image do
attachment { Rack::Test::UploadedFile.new("spec/fixtures/files/clippy.jpg") }
title { "Lorem ipsum dolor sit amet" }
association :user, factory: :user
association :user
trait :proposal_image do
association :imageable, factory: :proposal
@@ -19,7 +19,7 @@ FactoryBot.define do
factory :document do
sequence(:title) { |n| "Document title #{n}" }
association :user, factory: :user
association :user
attachment { Rack::Test::UploadedFile.new("spec/fixtures/files/empty.pdf") }
trait :proposal_document do

View File

@@ -1,6 +1,6 @@
FactoryBot.define do
factory :machine_learning_job do
association :user, factory: :user
association :user
script { "script.py" }
started_at { Time.current }
finished_at { nil }

View File

@@ -126,7 +126,7 @@ FactoryBot.define do
end
factory :follow do
association :user, factory: :user
association :user
trait :followed_proposal do
association :followable, factory: :proposal