Commit 7424e790 authored by Peter Leitzen's avatar Peter Leitzen

Publish status page on issue update

parent 4cd0a931
......@@ -16,6 +16,8 @@ module EE
Epics::UpdateDatesService.new([issue.epic]).execute
end
StatusPage.trigger_publish(project, current_user, issue) if issue.valid?
result
end
......
......@@ -185,5 +185,35 @@ describe Issues::UpdateService do
end
end
end
describe 'publish to status page' do
let(:execute) { update_issue(params) }
let(:issue_id) { execute&.id }
context 'when update succeeds' do
let(:params) { { title: 'New title' } }
include_examples 'trigger status page publish'
end
context 'when closing' do
let(:params) { { state_event: 'close' } }
include_examples 'trigger status page publish'
end
context 'when reopening' do
let(:issue) { create(:issue, :closed, project: project) }
let(:params) { { state_event: 'reopen' } }
include_examples 'trigger status page publish'
end
context 'when update fails' do
let(:params) { { title: nil } }
include_examples 'no trigger status page publish'
end
end
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