Commit 74e9d168 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'al-rubocop-inline-association-audit-events' into 'master'

Fix cop FactoryBot/InlineAssociation for audit_events

See merge request gitlab-org/gitlab!45806
parents 059fe6ad 03918d95
...@@ -1269,7 +1269,6 @@ FactoryBot/InlineAssociation: ...@@ -1269,7 +1269,6 @@ FactoryBot/InlineAssociation:
- 'ee/spec/factories/resource_weight_events.rb' - 'ee/spec/factories/resource_weight_events.rb'
- 'ee/spec/factories/vulnerabilities/feedback.rb' - 'ee/spec/factories/vulnerabilities/feedback.rb'
- 'spec/factories/atlassian_identities.rb' - 'spec/factories/atlassian_identities.rb'
- 'spec/factories/audit_events.rb'
- 'spec/factories/design_management/design_at_version.rb' - 'spec/factories/design_management/design_at_version.rb'
- 'spec/factories/design_management/designs.rb' - 'spec/factories/design_management/designs.rb'
- 'spec/factories/design_management/versions.rb' - 'spec/factories/design_management/versions.rb'
......
...@@ -4,7 +4,7 @@ FactoryBot.define do ...@@ -4,7 +4,7 @@ FactoryBot.define do
factory :audit_event, class: 'AuditEvent', aliases: [:user_audit_event] do factory :audit_event, class: 'AuditEvent', aliases: [:user_audit_event] do
user user
transient { target_user { create(:user) } } transient { target_user { association(:user) } }
entity_type { 'User' } entity_type { 'User' }
entity_id { target_user.id } entity_id { target_user.id }
...@@ -27,7 +27,7 @@ FactoryBot.define do ...@@ -27,7 +27,7 @@ FactoryBot.define do
end end
trait :project_event do trait :project_event do
transient { target_project { create(:project) } } transient { target_project { association(:project) } }
entity_type { 'Project' } entity_type { 'Project' }
entity_id { target_project.id } entity_id { target_project.id }
...@@ -50,7 +50,7 @@ FactoryBot.define do ...@@ -50,7 +50,7 @@ FactoryBot.define do
end end
trait :group_event do trait :group_event do
transient { target_group { create(:group) } } transient { target_group { association(:group) } }
entity_type { 'Group' } entity_type { 'Group' }
entity_id { target_group.id } entity_id { target_group.id }
......
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