Commit fc00774e authored by Peter Leitzen's avatar Peter Leitzen

Publish status page on issue destroy

parent 5e0243b5
...@@ -10,6 +10,7 @@ module EE ...@@ -10,6 +10,7 @@ module EE
super super
Analytics::RefreshCommentsData.for_note(note)&.execute(force: true) Analytics::RefreshCommentsData.for_note(note)&.execute(force: true)
StatusPage.trigger_publish(project, current_user, note)
end end
end end
end end
......
...@@ -3,19 +3,33 @@ ...@@ -3,19 +3,33 @@
require 'spec_helper' require 'spec_helper'
describe Notes::DestroyService do describe Notes::DestroyService do
subject { described_class.new(note.project) } let_it_be(:project, refind: true) { create(:project) }
let_it_be(:user) { create(:user) }
let(:note) { create(:note) } let_it_be(:note, refind: true) do
create(:note_on_issue, project: project, author: user)
end
subject(:service) { described_class.new(project, user) }
describe '#execute' do describe '#execute' do
let(:analytics_mock) { instance_double('Analytics::RefreshCommentsData') } describe 'refresh analytics comment data' do
let(:analytics_mock) { instance_double('Analytics::RefreshCommentsData') }
it 'invokes forced Analytics::RefreshCommentsData' do
allow(Analytics::RefreshCommentsData).to receive(:for_note).with(note).and_return(analytics_mock)
it 'invokes forced Analytics::RefreshCommentsData' do expect(analytics_mock).to receive(:execute).with(force: true)
allow(Analytics::RefreshCommentsData).to receive(:for_note).with(note).and_return(analytics_mock)
service.execute(note)
end
end
expect(analytics_mock).to receive(:execute).with(force: true) describe 'publish to status page' do
let(:execute) { service.execute(note) }
let(:issue_id) { note.noteable_id }
subject.execute(note) include_examples 'trigger status page publish'
end end
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