Commit 9ea25a71 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'dz/2374-update-min-users-selectable-for-subscription' into 'master'

Refactor show_plans helper

See merge request gitlab-org/gitlab!67675
parents 81481724 b8e4b3a4
......@@ -89,9 +89,13 @@ module BillingPlansHelper
end
def show_plans?(namespace)
return false if namespace.free_personal?
namespace.trial_active? || !(namespace.gold_plan? || namespace.ultimate_plan?)
if namespace.free_personal?
false
elsif namespace.trial_active?
true
else
!highest_tier?(namespace)
end
end
def show_trial_banner?(namespace)
......@@ -190,6 +194,10 @@ module BillingPlansHelper
.execute
end
end
def highest_tier?(namespace)
namespace.gold_plan? || namespace.ultimate_plan?
end
end
BillingPlansHelper.prepend_mod
......@@ -561,8 +561,6 @@ RSpec.describe BillingPlansHelper do
false | true | false | true | true
false | false | true | true | false
false | true | true | true | true
false | true | true | true | true
false | true | true | true | true
true | true | true | true | false
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