Commit b8e4b3a4 authored by Diana Zubova's avatar Diana Zubova Committed by Sean McGivern

Refactor show_plans helper

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