diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-15 12:34:27 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-15 12:34:27 +0300 |
commit | 94a9effeec183894123f4ea7ad9faa19da3e6b0b (patch) | |
tree | c1c541804f20b24fe2daac55cbc269c820afe58c /spec/services/delete_branch_service_spec.rb | |
parent | e552e1fc22c66c593c4479d85b7a770fda09e5d0 (diff) |
Test call to after branch delete hooks in service
Diffstat (limited to 'spec/services/delete_branch_service_spec.rb')
-rw-r--r-- | spec/services/delete_branch_service_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/delete_branch_service_spec.rb b/spec/services/delete_branch_service_spec.rb index 336f5dafb5b..3ca4eb14518 100644 --- a/spec/services/delete_branch_service_spec.rb +++ b/spec/services/delete_branch_service_spec.rb @@ -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 |