gitlab-org--gitlab-foss/spec/services/wiki_pages/destroy_service_spec.rb

25 lines
511 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
describe WikiPages::DestroyService do
let(:project) { create(:project) }
let(:user) { create(:user) }
2017-06-01 15:27:52 -04:00
let(:page) { create(:wiki_page) }
2017-06-01 15:27:52 -04:00
subject(:service) { described_class.new(project, user) }
2017-06-01 15:27:52 -04:00
before do
project.add_developer(user)
end
describe '#execute' do
it 'executes webhooks' do
2017-06-01 15:27:52 -04:00
expect(service).to receive(:execute_hooks).once
.with(instance_of(WikiPage), 'delete')
2017-06-01 15:27:52 -04:00
service.execute(page)
end
end
end