Commit b8bbf57d authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'pl-rubocop-inline-association-ee-resources' into 'master'

Fix cop FactoryBot/InlineAssociation for EE resource events

See merge request gitlab-org/gitlab!46038
parents cfc6a8bf 561a6e47
......@@ -1263,8 +1263,6 @@ FactoryBot/InlineAssociation:
- 'ee/spec/factories/geo/event_log.rb'
- 'ee/spec/factories/groups.rb'
- 'ee/spec/factories/merge_request_blocks.rb'
- 'ee/spec/factories/resource_iteration_event.rb'
- 'ee/spec/factories/resource_weight_events.rb'
- 'ee/spec/factories/vulnerabilities/feedback.rb'
- 'spec/factories/atlassian_identities.rb'
- 'spec/factories/design_management/design_at_version.rb'
......
......@@ -2,10 +2,10 @@
FactoryBot.define do
factory :resource_iteration_event do
issue { merge_request.nil? ? create(:issue) : nil }
issue { merge_request.nil? ? association(:issue) : nil }
merge_request { nil }
iteration
action { :add }
user { issue&.author || merge_request&.author || create(:user) }
user { issue&.author || merge_request&.author || association(:user) }
end
end
......@@ -2,7 +2,7 @@
FactoryBot.define do
factory :resource_weight_event do
issue { create(:issue) }
user { issue&.author || create(:user) }
issue { association(:issue) }
user { issue&.author || association(:user) }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment