Test call to after branch delete hooks in service

This commit is contained in:
Grzegorz Bizon 2016-11-15 10:34:27 +01:00
parent e552e1fc22
commit 94a9effeec

View file

@ -20,6 +20,12 @@ describe DeleteBranchService, services: true do
expect(result[:status]).to eq :success
expect(branch_exists?('feature')).to be false
end
it 'calls after branch delete hooks' do
expect(service).to receive(:execute_after_branch_delete_hooks)
service.execute('feature')
end
end
context 'when user does not have access to push to repository' do
@ -32,6 +38,12 @@ describe DeleteBranchService, services: true do
expect(result[:message]).to eq 'You dont have push access to repo'
expect(branch_exists?('feature')).to be true
end
it 'does not call after branch delete hooks' do
expect(service).not_to receive(:execute_after_branch_delete_hooks)
service.execute('feature')
end
end
end