2016-12-20 13:32:43 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-10 14:24:02 +00:00
|
|
|
describe WikiPages::DestroyService do
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project) }
|
2016-12-20 13:32:43 +00:00
|
|
|
let(:user) { create(:user) }
|
2017-06-01 19:27:52 +00:00
|
|
|
let(:page) { create(:wiki_page) }
|
2016-12-20 13:32:43 +00:00
|
|
|
|
2017-06-01 19:27:52 +00:00
|
|
|
subject(:service) { described_class.new(project, user) }
|
2016-12-20 13:32:43 +00:00
|
|
|
|
2017-06-01 19:27:52 +00:00
|
|
|
before do
|
|
|
|
project.add_developer(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#execute' do
|
2016-12-20 13:32:43 +00:00
|
|
|
it 'executes webhooks' do
|
2017-06-01 19:27:52 +00:00
|
|
|
expect(service).to receive(:execute_hooks).once
|
|
|
|
.with(instance_of(WikiPage), 'delete')
|
2016-12-20 13:32:43 +00:00
|
|
|
|
2017-06-01 19:27:52 +00:00
|
|
|
service.execute(page)
|
2016-12-20 13:32:43 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|