Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/hooks/web_hook_spec.rb')
-rw-r--r--spec/models/hooks/web_hook_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/hooks/web_hook_spec.rb b/spec/models/hooks/web_hook_spec.rb
index 6419a9fc9d9..da8c10b67a6 100644
--- a/spec/models/hooks/web_hook_spec.rb
+++ b/spec/models/hooks/web_hook_spec.rb
@@ -139,6 +139,16 @@ RSpec.describe WebHook do
it { is_expected.to contain_exactly(:token, :url, :url_variables) }
end
+ describe '.web_hooks_disable_failed?' do
+ it 'returns true when feature is enabled for parent' do
+ second_hook = build(:project_hook, project: create(:project))
+ stub_feature_flags(web_hooks_disable_failed: [false, second_hook.project])
+
+ expect(described_class.web_hooks_disable_failed?(hook)).to eq(false)
+ expect(described_class.web_hooks_disable_failed?(second_hook)).to eq(true)
+ end
+ end
+
describe 'execute' do
let(:data) { { key: 'value' } }
let(:hook_name) { 'project hook' }