2016-01-28 18:04:24 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-10 14:24:02 +00:00
|
|
|
describe Notes::PostProcessService do
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project) }
|
2016-01-28 18:04:24 +00:00
|
|
|
let(:issue) { create(:issue, project: project) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
2016-07-11 22:12:31 +00:00
|
|
|
describe '#execute' do
|
2016-01-28 18:04:24 +00:00
|
|
|
before do
|
2017-12-22 08:18:28 +00:00
|
|
|
project.add_master(user)
|
2016-01-28 18:04:24 +00:00
|
|
|
note_opts = {
|
|
|
|
note: 'Awesome comment',
|
|
|
|
noteable_type: 'Issue',
|
|
|
|
noteable_id: issue.id
|
|
|
|
}
|
|
|
|
|
|
|
|
@note = Notes::CreateService.new(project, user, note_opts).execute
|
|
|
|
end
|
|
|
|
|
2016-01-28 18:23:37 +00:00
|
|
|
it do
|
2016-01-28 18:04:24 +00:00
|
|
|
expect(project).to receive(:execute_hooks)
|
|
|
|
expect(project).to receive(:execute_services)
|
2016-02-18 23:53:22 +00:00
|
|
|
|
2017-07-25 17:09:00 +00:00
|
|
|
described_class.new(@note).execute
|
2016-01-28 18:23:37 +00:00
|
|
|
end
|
2016-01-28 18:04:24 +00:00
|
|
|
end
|
|
|
|
end
|