Commit c9766e3d authored by Stan Hu's avatar Stan Hu

Merge branch 'ebaque-remove-render_billings_gold_trial' into 'master'

Remove unused render_billings_gold_trial

See merge request gitlab-org/gitlab!54294
parents 0b82f6e2 02126a76
......@@ -9,7 +9,6 @@ module EE
GEO_ENABLE_HASHED_STORAGE = 'geo_enable_hashed_storage'
GEO_MIGRATE_HASHED_STORAGE = 'geo_migrate_hashed_storage'
GOLD_TRIAL = 'gold_trial'
GOLD_TRIAL_BILLINGS = 'gold_trial_billings'
NEW_USER_SIGNUPS_CAP_REACHED = 'new_user_signups_cap_reached'
PERSONAL_ACCESS_TOKEN_EXPIRY = 'personal_access_token_expiry'
THREAT_MONITORING_INFO = 'threat_monitoring_info'
......@@ -63,14 +62,6 @@ module EE
render 'shared/check_recovery_settings'
end
def render_billings_gold_trial(user, namespace)
return if namespace.gold_plan?
return unless namespace.never_had_trial?
return unless show_gold_trial?(user, GOLD_TRIAL_BILLINGS)
render 'shared/gold_trial_callout_content', is_dismissable: !namespace.free_plan?, callout: GOLD_TRIAL_BILLINGS
end
def show_threat_monitoring_info?
!user_dismissed?(THREAT_MONITORING_INFO)
end
......
......@@ -179,57 +179,6 @@ RSpec.describe EE::UserCalloutsHelper do
end
end
describe '#render_billings_gold_trial' do
let(:namespace) { create(:namespace) }
let_it_be(:free_plan) { create(:free_plan) }
let_it_be(:silver_plan) { create(:silver_plan) }
let_it_be(:gold_plan) { create(:gold_plan) }
let(:user) { namespace.owner }
where(:never_had_trial?, :show_gold_trial?, :gold_plan?, :free_plan?, :should_render?) do
true | true | false | false | true
true | true | false | true | true
true | true | true | true | false
true | true | true | false | false
true | false | true | true | false
true | false | false | true | false
true | false | true | false | false
true | false | false | false | false
false | true | false | false | false
false | true | false | true | false
false | true | true | true | false
false | true | true | false | false
false | false | true | true | false
false | false | false | true | false
false | false | true | false | false
false | false | false | false | false
end
with_them do
before do
allow(helper).to receive(:show_gold_trial?) { show_gold_trial? }
if !never_had_trial?
create(:gitlab_subscription, namespace: namespace, hosted_plan: free_plan, trial_ends_on: Date.yesterday)
elsif gold_plan?
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
elsif !free_plan?
create(:gitlab_subscription, namespace: namespace, hosted_plan: silver_plan)
end
end
it do
if should_render?
expect(helper).to receive(:render).with('shared/gold_trial_callout_content', is_dismissable: !free_plan?, callout: UserCalloutsHelper::GOLD_TRIAL_BILLINGS)
else
expect(helper).not_to receive(:render)
end
helper.render_billings_gold_trial(user, namespace)
end
end
end
describe '#render_account_recovery_regular_check' do
let(:new_user) { create(:user) }
let(:old_user) { create(:user, created_at: 4.months.ago )}
......
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