Commit 9294ac4d authored by Kerri Miller's avatar Kerri Miller

Merge branch '283875_remove_reset_integrations_feature_flag' into 'master'

Remove reset_integrations feature flag

See merge request gitlab-org/gitlab!51507
parents 35fed52e d8685ee8
......@@ -76,6 +76,8 @@ module ServicesHelper
end
def scoped_reset_integration_path(integration, group: nil)
return '' unless integration.persisted?
if group.present?
reset_group_settings_integration_path(group, integration)
else
......@@ -102,7 +104,7 @@ module ServicesHelper
cancel_path: scoped_integrations_path,
can_test: integration.can_test?.to_s,
test_path: scoped_test_integration_path(integration),
reset_path: reset_integration?(integration, group: group) ? scoped_reset_integration_path(integration, group: group) : ''
reset_path: scoped_reset_integration_path(integration, group: group)
}
end
......@@ -126,10 +128,6 @@ module ServicesHelper
!Gitlab.com?
end
def reset_integration?(integration, group: nil)
integration.persisted? && Feature.enabled?(:reset_integrations, group, type: :development)
end
extend self
private
......
---
title: Allow resetting group and instance level integrations
merge_request: 51507
author:
type: added
---
name: reset_integrations
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47546
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/283875
milestone: '13.7'
type: development
group: group::ecosystem
default_enabled: false
......@@ -25,6 +25,10 @@ RSpec.describe ServicesHelper do
:integration_level
)
end
specify do
expect(subject[:reset_path]).to eq(helper.scoped_reset_integration_path(integration))
end
end
end
......@@ -47,52 +51,12 @@ RSpec.describe ServicesHelper do
is_expected.to eq(reset_group_settings_integration_path(group, integration))
end
end
end
describe '#reset_integration?' do
let(:group) { nil }
subject { helper.reset_integration?(integration, group: group) }
context 'when integration is existing record' do
let_it_be(:integration) { create(:jira_service) }
context 'when `reset_integrations` is not enabled' do
it 'returns false' do
stub_feature_flags(reset_integrations: false)
is_expected.to eq(false)
end
end
context 'when `reset_integrations` is enabled' do
it 'returns true' do
stub_feature_flags(reset_integrations: true)
is_expected.to eq(true)
end
end
context 'when `reset_integrations` is enabled for a group' do
let(:group) { build_stubbed(:group) }
it 'returns true' do
stub_feature_flags(reset_integrations: group)
is_expected.to eq(true)
end
end
end
context 'when integration is a new record' do
context 'when a new integration is not persisted' do
let_it_be(:integration) { build(:jira_service) }
context 'when `reset_integrations` is enabled' do
it 'returns false' do
stub_feature_flags(reset_integrations: true)
is_expected.to eq(false)
end
it 'returns an empty string' do
is_expected.to eq('')
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