Commit 16d64516 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 0f708739
......@@ -81,6 +81,8 @@ RSpec.describe Event do
describe 'validations' do
describe 'action' do
context 'for a design' do
let_it_be(:author) { create(:user) }
where(:action, :valid) do
valid = described_class::DESIGN_ACTIONS.map(&:to_s).to_set
......@@ -90,7 +92,7 @@ RSpec.describe Event do
end
with_them do
let(:event) { build(:design_event, action: action) }
let(:event) { build(:design_event, author: author, action: action) }
specify { expect(event.valid?).to eq(valid) }
end
......@@ -729,9 +731,9 @@ RSpec.describe Event do
else
{}
end
target = kind == :project ? nil : build(kind, **extra_data)
[kind, build(:event, :created, project: project, target: target)]
[kind, build(:event, :created, author: project.owner, project: project, target: target)]
end.to_h
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