Commit 4cd0a931 authored by Peter Leitzen's avatar Peter Leitzen

Publish status page on issue create

parent f4835bb4
......@@ -12,6 +12,13 @@ module EE
super
end
override :after_create
def after_create(issue)
super
StatusPage.trigger_publish(project, current_user, issue)
end
def handle_issue_epic_link(issue)
return unless params.key?(:epic)
......
......@@ -43,5 +43,22 @@ describe Issues::CreateService do
it_behaves_like 'issue with epic_id parameter' do
let(:execute) { service.execute }
end
describe 'publish to status page' do
let(:execute) { service.execute }
let(:issue_id) { execute&.id }
context 'when creation succeeds' do
let(:params) { { title: 'New title' } }
include_examples 'trigger status page publish'
end
context 'when creation 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