diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /spec/models/hooks/web_hook_spec.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'spec/models/hooks/web_hook_spec.rb')
-rw-r--r-- | spec/models/hooks/web_hook_spec.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/models/hooks/web_hook_spec.rb b/spec/models/hooks/web_hook_spec.rb index c292e78b32d..482e372543c 100644 --- a/spec/models/hooks/web_hook_spec.rb +++ b/spec/models/hooks/web_hook_spec.rb @@ -100,12 +100,18 @@ RSpec.describe WebHook do hook.execute(data, hook_name) end - it 'does not execute non-executable hooks' do - hook.update!(disabled_until: 1.day.from_now) + it 'passes force: false to the web hook service by default' do + expect(WebHookService) + .to receive(:new).with(hook, data, hook_name, force: false).and_return(double(execute: :done)) - expect(WebHookService).not_to receive(:new) + expect(hook.execute(data, hook_name)).to eq :done + end - hook.execute(data, hook_name) + it 'passes force: true to the web hook service if required' do + expect(WebHookService) + .to receive(:new).with(hook, data, hook_name, force: true).and_return(double(execute: :forced)) + + expect(hook.execute(data, hook_name, force: true)).to eq :forced end it '#async_execute' do |