2016-01-28 13:04:24 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-01-28 13:23:37 -05:00
|
|
|
describe Notes::PostProcessService, services: true do
|
2016-01-28 13:04:24 -05:00
|
|
|
let(:project) { create(:empty_project) }
|
|
|
|
let(:issue) { create(:issue, project: project) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
describe :execute do
|
|
|
|
before do
|
|
|
|
project.team << [user, :master]
|
|
|
|
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 13:23:37 -05:00
|
|
|
it do
|
2016-01-28 13:04:24 -05:00
|
|
|
expect(project).to receive(:execute_hooks)
|
|
|
|
expect(project).to receive(:execute_services)
|
|
|
|
Notes::PostProcessService.new(@note).execute
|
2016-01-28 13:23:37 -05:00
|
|
|
end
|
2016-01-28 13:04:24 -05:00
|
|
|
end
|
|
|
|
end
|