Commit ec3a16da authored by Alper Akgun's avatar Alper Akgun

New checkout flow for free groups on gitlab.com

parent e06ee9c3
...@@ -22,8 +22,7 @@ module BillingPlansHelper ...@@ -22,8 +22,7 @@ module BillingPlansHelper
def use_new_purchase_flow?(namespace) def use_new_purchase_flow?(namespace)
namespace.group? && namespace.group? &&
namespace.actual_plan_name == Plan::FREE && namespace.actual_plan_name == Plan::FREE
Feature.enabled?(:free_group_new_purchase_flow, current_user)
end end
def show_contact_sales_button?(purchase_link_action) def show_contact_sales_button?(purchase_link_action)
......
---
title: New checkout flow for free groups on gitlab.com
merge_request: 41644
author:
type: added
...@@ -46,8 +46,7 @@ RSpec.describe BillingPlansHelper do ...@@ -46,8 +46,7 @@ RSpec.describe BillingPlansHelper do
end end
describe '#use_new_purchase_flow?' do describe '#use_new_purchase_flow?' do
where free_group_new_purchase: [true, false], where type: ['Group', nil],
type: ['Group', nil],
plan: Plan.all_plans plan: Plan.all_plans
with_them do with_them do
...@@ -59,13 +58,12 @@ RSpec.describe BillingPlansHelper do ...@@ -59,13 +58,12 @@ RSpec.describe BillingPlansHelper do
before do before do
allow(helper).to receive(:current_user).and_return(user) allow(helper).to receive(:current_user).and_return(user)
stub_feature_flags free_group_new_purchase_flow: free_group_new_purchase
end end
subject { helper.use_new_purchase_flow?(namespace) } subject { helper.use_new_purchase_flow?(namespace) }
it do it do
result = free_group_new_purchase && type == 'Group' && plan == Plan::FREE result = type == 'Group' && plan == Plan::FREE
is_expected.to be(result) is_expected.to be(result)
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