Commit 477896c4 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu Committed by Eugenia Grieff

Fix event spec

These validation specs need a persisted author because there is a
validation for `author_id`
parent 0422c4a6
......@@ -722,7 +722,14 @@ RSpec.describe Event do
note_on_commit: true
}
valid_target_factories.map do |kind, needs_project|
extra_data = needs_project ? { project: project } : {}
extra_data = if kind == :merge_request
{ source_project: project }
elsif needs_project
{ project: project }
else
{}
end
target = kind == :project ? nil : build(kind, **extra_data)
[kind, build(:event, :created, project: project, target: target)]
end.to_h
......
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