summaryrefslogtreecommitdiff
path: root/spec/services/wiki_pages/destroy_service_spec.rb
blob: a4b9a390fe21f1d456cd77a3bc685f171aa37c8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'spec_helper'

describe WikiPages::DestroyService, services: true do
  let(:project) { create(:empty_project) }
  let(:user) { create(:user) }
  let(:wiki_page) { create(:wiki_page) }
  let(:service) { described_class.new(project, user) }

  describe '#execute' do
    before do
      allow(service).to receive(:execute_hooks)
      project.add_master(user)
    end

    it 'executes webhooks' do
      service.execute(wiki_page)

      expect(service).to have_received(:execute_hooks).once.with(wiki_page, 'delete')
    end
  end
end