Test call to after branch delete hooks in service
This commit is contained in:
parent
e552e1fc22
commit
94a9effeec
1 changed files with 12 additions and 0 deletions
|
@ -20,6 +20,12 @@ describe DeleteBranchService, services: true do
|
||||||
expect(result[:status]).to eq :success
|
expect(result[:status]).to eq :success
|
||||||
expect(branch_exists?('feature')).to be false
|
expect(branch_exists?('feature')).to be false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'calls after branch delete hooks' do
|
||||||
|
expect(service).to receive(:execute_after_branch_delete_hooks)
|
||||||
|
|
||||||
|
service.execute('feature')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user does not have access to push to repository' do
|
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(result[:message]).to eq 'You dont have push access to repo'
|
||||||
expect(branch_exists?('feature')).to be true
|
expect(branch_exists?('feature')).to be true
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue