summaryrefslogtreecommitdiff
path: root/spec/services/notes/post_process_service_spec.rb
blob: 1a3f339bd641a1c0f3ffb94de1f8abce7fae2cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'spec_helper'

describe Notes::PostProcessService, services: true do
  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

    it do
      expect(project).to receive(:execute_hooks)
      expect(project).to receive(:execute_services)
      Notes::PostProcessService.new(@note).execute
    end
  end
end