Commit 75fa682c authored by James Lopez's avatar James Lopez

Merge branch '32588-move-privacy-policy-update-callout-behind-ff' into 'master'

Use `privacy_policy_update_callout` feature flag for Privacy Policy Update callout

Closes #32588

See merge request gitlab-org/gitlab!17592
parents 8dfbefcf 2ec97d1c
......@@ -6,6 +6,9 @@ module EE
extend ::Gitlab::Utils::Override
prepended do
before_action do
push_frontend_feature_flag(:privacy_policy_update_callout)
end
around_action :set_current_ip_address
end
......
......@@ -66,7 +66,7 @@ module EE
end
def show_privacy_policy_update?
!user_dismissed?(PRIVACY_POLICY_UPDATE)
::Feature.enabled?(:privacy_policy_update_callout) && !user_dismissed?(PRIVACY_POLICY_UPDATE)
end
private
......
......@@ -171,20 +171,35 @@ describe EE::UserCalloutsHelper do
describe '.show_privacy_policy_update?' do
subject { helper.show_privacy_policy_update? }
context 'when user has not dismissed' do
context 'when feature `privacy_policy_update_callout` is disabled' do
before do
allow(helper).to receive(:user_dismissed?).and_return(false)
Feature.get(:privacy_policy_update_callout).disable
allow(helper).to receive(:user_dismissed?).and_return(true)
end
it { is_expected.to be true }
it { is_expected.to be false }
end
context 'when user dismissed' do
context 'when feature `privacy_policy_update_callout` is enabled' do
before do
allow(helper).to receive(:user_dismissed?).and_return(true)
Feature.get(:privacy_policy_update_callout).enable
end
it { is_expected.to be false }
context 'when user has not dismissed' do
before do
allow(helper).to receive(:user_dismissed?).and_return(false)
end
it { is_expected.to be true }
end
context 'when user dismissed' do
before do
allow(helper).to receive(:user_dismissed?).and_return(true)
end
it { is_expected.to be false }
end
end
end
......
......@@ -94,14 +94,24 @@ describe ApplicationController do
request.path = '/-/peek'
end
it_behaves_like 'not setting gon variables'
# TODO:
# remove line below once `privacy_policy_update_callout`
# feature flag is removed and `gon` reverts back to
# to not setting any variables.
it_behaves_like 'setting gon variables'
# it_behaves_like 'not setting gon variables'
end
end
context 'with json format' do
let(:format) { :json }
it_behaves_like 'not setting gon variables'
# TODO:
# remove line below once `privacy_policy_update_callout`
# feature flag is removed and `gon` reverts back to
# to not setting any variables.
it_behaves_like 'setting gon variables'
# it_behaves_like 'not setting gon variables'
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