BigW Consortium Gitlab

Commit 94a9effe by Grzegorz Bizon

Test call to after branch delete hooks in service

parent e552e1fc
...@@ -20,6 +20,12 @@ describe DeleteBranchService, services: true do ...@@ -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 ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment