Commit 7530308f authored by Etienne Baqué's avatar Etienne Baqué

Replaced silver occurrences with premium

Replaced silver occurrences with premium
parent 36b60c36
......@@ -19,7 +19,7 @@ it should be restricted on namespace scope.
1. Add the feature symbol on `EES_FEATURES`, `EEP_FEATURES` or `EEU_FEATURES` constants in
`ee/app/models/license.rb`. Note on `ee/app/models/ee/namespace.rb` that _Bronze_ GitLab.com
features maps to on-premise _EES_, _Silver_ to _EEP_ and _Gold_ to _EEU_.
features maps to on-premise _EES_, _Silver/Premium_ to _EEP_ and _Gold/Ultimate_ to _EEU_.
1. Check using:
```ruby
......
......@@ -104,7 +104,7 @@ module Gitlab
case plan_name
when 'Gold', 'Ultimate'
_('After that, you will not be able to use merge approvals or epics as well as many security features.')
when 'Silver'
when 'Premium', 'Silver'
_('After that, you will not be able to use merge approvals or epics as well as many other features.')
else
_('After that, you will not be able to use merge approvals or code quality as well as many other features.')
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Changes GL.com plan for group' do
include WaitForRequests
let!(:silver_plan) { create(:silver_plan) }
let!(:premium_plan) { create(:premium_plan) }
let(:admin) { create(:admin) }
before do
......@@ -28,7 +28,7 @@ RSpec.describe 'Changes GL.com plan for group' do
click_button('Save changes')
expect(page).to have_content('Plan: Premium (Formerly Silver)')
expect(page).to have_content('Plan: Premium')
end
end
......@@ -45,7 +45,7 @@ RSpec.describe 'Changes GL.com plan for group' do
click_button('Save changes')
expect(page).to have_content('Plan: Premium (Formerly Silver)')
expect(page).to have_content('Plan: Premium')
end
end
end
......@@ -10,7 +10,7 @@ RSpec.describe 'Billing plan pages', :feature do
let(:namespace) { user.namespace }
let(:free_plan) { create(:free_plan) }
let(:bronze_plan) { create(:bronze_plan) }
let(:silver_plan) { create(:silver_plan) }
let(:premium_plan) { create(:premium_plan) }
let(:ultimate_plan) { create(:ultimate_plan) }
let(:plans_data) do
Gitlab::Json.parse(File.read(Rails.root.join('ee/spec/fixtures/gitlab_com_plans.json'))).map do |data|
......@@ -56,7 +56,7 @@ RSpec.describe 'Billing plan pages', :feature do
# see ApplicationHelper#contact_sales_url
contact_sales_url = 'https://about.gitlab.com/sales'
page.within('.content') do
expect(page).to have_link('Contact sales', href: %r{#{contact_sales_url}\?test=inappcontactsales(bronze|silver|gold)})
expect(page).to have_link('Contact sales', href: %r{#{contact_sales_url}\?test=inappcontactsales(bronze|premium|gold)})
end
end
end
......@@ -187,8 +187,8 @@ RSpec.describe 'Billing plan pages', :feature do
it_behaves_like 'plan with subscription table'
end
context 'on silver plan' do
let(:plan) { silver_plan }
context 'on premium plan' do
let(:plan) { premium_plan }
let!(:subscription) do
create(:gitlab_subscription, namespace: namespace, hosted_plan: plan, seats: 15)
......
......@@ -15,7 +15,7 @@ RSpec.describe ProjectsFinder do
let_it_be(:ultimate_project) { create_project(:ultimate_plan) }
let_it_be(:ultimate_project2) { create_project(:ultimate_plan) }
let_it_be(:silver_project) { create_project(:silver_plan) }
let_it_be(:premium_project) { create_project(:premium_plan) }
let_it_be(:no_plan_project) { create_project(nil) }
context 'with ultimate plan' do
......@@ -25,9 +25,9 @@ RSpec.describe ProjectsFinder do
end
context 'with multiple plans' do
let(:plans) { %w[ultimate silver] }
let(:plans) { %w[ultimate premium] }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, silver_project) }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, premium_project) }
end
context 'with other plans' do
......@@ -39,13 +39,13 @@ RSpec.describe ProjectsFinder do
context 'without plans' do
let(:plans) { nil }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, silver_project, no_plan_project) }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, premium_project, no_plan_project) }
end
context 'with empty plans' do
let(:plans) { [] }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, silver_project, no_plan_project) }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, premium_project, no_plan_project) }
end
context 'filter by aimed for deletion' do
......
......@@ -23,7 +23,7 @@ RSpec.describe GroupsWithTemplatesFinder do
create(:project, namespace: subgroup_2)
create(:project, namespace: subgroup_3)
create(:gitlab_subscription, :ultimate, namespace: group_1)
create(:gitlab_subscription, :silver, namespace: group_2)
create(:gitlab_subscription, :premium, namespace: group_2)
end
describe 'without group id' do
......@@ -36,7 +36,7 @@ RSpec.describe GroupsWithTemplatesFinder do
allow(Gitlab::CurrentSettings).to receive(:should_check_namespace_plan?) { true }
end
it 'returns groups on ultimate/silver plan' do
it 'returns groups on ultimate/premium plan' do
expect(described_class.new.execute).to contain_exactly(group_1, group_2)
end
......@@ -46,7 +46,7 @@ RSpec.describe GroupsWithTemplatesFinder do
create(:project, namespace: subgroup_5)
end
it 'returns groups on ultimate/silver plan' do
it 'returns groups on ultimate/premium plan' do
expect(described_class.new.execute).to contain_exactly(group_1, group_2, subgroup_4)
end
end
......
......@@ -94,9 +94,9 @@
"deprecated": true
},
{
"id": "silver-external-id",
"id": "premium-external-id",
"about_page_href": "https://about.gitlab.com/gitlab-com/",
"code": "silver",
"code": "premium",
"features": [
{
"highlight": false,
......@@ -120,7 +120,7 @@
}
],
"free": false,
"name": "Silver Plan",
"name": "Premium Plan",
"price_per_month": 19.0,
"price_per_year": 228.0,
"purchase_link": {
......@@ -147,7 +147,7 @@
},
{
"highlight": true,
"title": "All Silver features"
"title": "All Premium features"
},
{
"highlight": false,
......
......@@ -7,7 +7,7 @@ constants.TAX_RATE = 0;
describe('projectsSelector default state', () => {
const availablePlans = [
{ id: 'firstPlanId', code: 'bronze', price_per_year: 48, name: 'Bronze Plan' },
{ id: 'secondPlanId', code: 'silver', price_per_year: 228, name: 'silver Plan' },
{ id: 'secondPlanId', code: 'premium', price_per_year: 228, name: 'Premium Plan' },
];
const groupData = [
......@@ -39,7 +39,7 @@ describe('projectsSelector default state', () => {
it('sets the availablePlans to the provided parsed availablePlans', () => {
expect(state.availablePlans).toEqual([
{ value: 'firstPlanId', text: 'Bronze Plan', pricePerUserPerYear: 48 },
{ value: 'secondPlanId', text: 'Silver Plan', pricePerUserPerYear: 228 },
{ value: 'secondPlanId', text: 'Premium Plan', pricePerUserPerYear: 228 },
]);
});
......
......@@ -156,14 +156,14 @@ RSpec.describe BillingPlansHelper do
context 'when plan has a valid property' do
where(:plan_name, :for_free, :plan_id, :result) do
Plan::BRONZE | true | '123456789' | :upgrade_for_free
Plan::BRONZE | true | '987654321' | :no_offer
Plan::BRONZE | true | nil | :no_offer
Plan::BRONZE | false | '123456789' | :upgrade_for_offer
Plan::BRONZE | false | nil | :no_offer
Plan::BRONZE | nil | nil | :no_offer
Plan::SILVER | nil | nil | :no_offer
nil | true | nil | :no_offer
Plan::BRONZE | true | '123456789' | :upgrade_for_free
Plan::BRONZE | true | '987654321' | :no_offer
Plan::BRONZE | true | nil | :no_offer
Plan::BRONZE | false | '123456789' | :upgrade_for_offer
Plan::BRONZE | false | nil | :no_offer
Plan::BRONZE | nil | nil | :no_offer
Plan::PREMIUM | nil | nil | :no_offer
nil | true | nil | :no_offer
end
with_them do
......@@ -374,7 +374,7 @@ RSpec.describe BillingPlansHelper do
end
describe '#billing_available_plans' do
let(:plan) { double('Plan', deprecated?: false, code: 'silver', hide_deprecated_card?: false) }
let(:plan) { double('Plan', deprecated?: false, code: 'premium', hide_deprecated_card?: false) }
let(:deprecated_plan) { double('Plan', deprecated?: true, code: 'bronze', hide_deprecated_card?: false) }
let(:plans_data) { [plan, deprecated_plan] }
......@@ -385,7 +385,7 @@ RSpec.describe BillingPlansHelper do
end
context 'when namespace is on an active plan' do
let(:current_plan) { OpenStruct.new(code: 'silver') }
let(:current_plan) { OpenStruct.new(code: 'premium') }
it 'returns plans without deprecated' do
expect(helper.billing_available_plans(plans_data, nil)).to eq([plan])
......@@ -410,8 +410,8 @@ RSpec.describe BillingPlansHelper do
end
context 'when namespace is on a plan that has hide_deprecated_card set to true, but deprecated? is false' do
let(:current_plan) { OpenStruct.new(code: 'silver') }
let(:plan) { double('Plan', deprecated?: false, code: 'silver', hide_deprecated_card?: true) }
let(:current_plan) { OpenStruct.new(code: 'premium') }
let(:plan) { double('Plan', deprecated?: false, code: 'premium', hide_deprecated_card?: true) }
it 'returns plans with the deprecated plan' do
expect(helper.billing_available_plans(plans_data, current_plan)).to eq([plan])
......@@ -435,10 +435,10 @@ RSpec.describe BillingPlansHelper do
end
it 'breaks a tie with the current_subscription_plan attribute if multiple plans have the same code' do
other_plan = Hashie::Mash.new(current_subscription_plan: false, code: 'silver')
current_plan = Hashie::Mash.new(current_subscription_plan: true, code: 'silver')
other_plan = Hashie::Mash.new(current_subscription_plan: false, code: 'premium')
current_plan = Hashie::Mash.new(current_subscription_plan: true, code: 'premium')
expect(helper.subscription_plan_info([other_plan, current_plan], 'silver')).to eq(current_plan)
expect(helper.subscription_plan_info([other_plan, current_plan], 'premium')).to eq(current_plan)
end
it 'returns nil if no plan matches the code even if current_subscription_plan is true' do
......@@ -450,9 +450,9 @@ RSpec.describe BillingPlansHelper do
it 'returns the plan matching the plan code even if current_subscription_plan is false' do
other_plan = Hashie::Mash.new(current_subscription_plan: false, code: 'bronze')
current_plan = Hashie::Mash.new(current_subscription_plan: false, code: 'silver')
current_plan = Hashie::Mash.new(current_subscription_plan: false, code: 'premium')
expect(helper.subscription_plan_info([other_plan, current_plan], 'silver')).to eq(current_plan)
expect(helper.subscription_plan_info([other_plan, current_plan], 'premium')).to eq(current_plan)
end
end
end
......@@ -28,14 +28,14 @@ RSpec.describe Gitlab::ApplicationContext do
end
it 'falls back to a projects namespace plan when a project is passed but no namespace' do
create(:gitlab_subscription, :silver, namespace: project.namespace)
create(:gitlab_subscription, :premium, namespace: project.namespace)
project.actual_plan_name
context = described_class.new(project: project)
expect(result(context))
.to include(project: project.full_path,
root_namespace: project.full_path_components.first,
subscription_plan: 'silver')
subscription_plan: 'premium')
end
end
......
......@@ -196,10 +196,14 @@ RSpec.describe Gitlab::ExpiringSubscriptionMessage do
end
end
it 'has silver plan specific messaging' do
allow(subscribable).to receive(:plan).and_return('silver')
where plan: %w(silver premium)
expect(subject).to include('Your Silver subscription for No Limit Records will expire on 2020-03-09. After that, you will not be able to use merge approvals or epics as well as many other features.')
with_them do
it 'has plan specific messaging' do
allow(subscribable).to receive(:plan).and_return('premium')
expect(subject).to include('Your Premium subscription for No Limit Records will expire on 2020-03-09. After that, you will not be able to use merge approvals or epics as well as many other features.')
end
end
it 'has bronze plan specific messaging' do
......
......@@ -11,7 +11,7 @@ RSpec.describe Namespace do
let(:default_plan) { create(:default_plan) }
let(:free_plan) { create(:free_plan) }
let!(:bronze_plan) { create(:bronze_plan) }
let!(:silver_plan) { create(:silver_plan) }
let!(:premium_plan) { create(:premium_plan) }
let!(:ultimate_plan) { create(:ultimate_plan) }
it { is_expected.to have_one(:namespace_statistics) }
......@@ -971,7 +971,7 @@ RSpec.describe Namespace do
end
context 'with other plans' do
%i[bronze_plan silver_plan].each do |plan|
%i[bronze_plan premium_plan].each do |plan|
it 'includes active guest users' do
create(:gitlab_subscription, namespace: group, hosted_plan: send(plan))
expect(group.billed_user_ids).to match_array([guest.id, developer.id])
......@@ -1133,7 +1133,7 @@ RSpec.describe Namespace do
end
context 'with other plans' do
%i[bronze_plan silver_plan].each do |plan|
%i[bronze_plan premium_plan].each do |plan|
it 'counts active guest users' do
create(:gitlab_subscription, namespace: group, hosted_plan: send(plan))
expect(group.billable_members_count).to eq(2)
......
......@@ -513,7 +513,7 @@ RSpec.describe User do
allow(Gitlab::CurrentSettings).to receive(:should_check_namespace_plan?) { true }
end
it 'returns groups on ultimate or silver plans' do
it 'returns groups on ultimate or premium plans' do
groups = user.available_subgroups_with_custom_project_templates
expect(groups.size).to eq(1)
......@@ -922,7 +922,7 @@ RSpec.describe User do
context 'when namespace is on a plan that is not free or ultimate' do
before do
create(:gitlab_subscription, namespace: namespace, hosted_plan: create(:silver_plan))
create(:gitlab_subscription, namespace: namespace, hosted_plan: create(:premium_plan))
end
context 'user is a guest' do
......@@ -1502,7 +1502,7 @@ RSpec.describe User do
where(:hosted_plan, :result) do
:bronze_plan | true
:silver_plan | true
:premium_plan | true
:ultimate_plan | false
:free_plan | false
:default_plan | false
......@@ -1529,7 +1529,7 @@ RSpec.describe User do
it 'returns false when the user has multiple groups and any group has ultimate' do
create(:group_with_plan, plan: :bronze_plan).add_owner(user)
create(:group_with_plan, plan: :silver_plan).add_owner(user)
create(:group_with_plan, plan: :premium_plan).add_owner(user)
create(:group_with_plan, plan: :ultimate_plan).add_owner(user)
user.namespace.plans.reload
......
......@@ -43,7 +43,7 @@ RSpec.describe ElasticsearchIndexedNamespace do
let_it_be(:namespaces) { create_list(:namespace, 3) }
let_it_be(:subscription1) { create(:gitlab_subscription, namespace: namespaces[2]) }
let_it_be(:subscription2) { create(:gitlab_subscription, namespace: namespaces[0]) }
let_it_be(:subscription3) { create(:gitlab_subscription, :silver, namespace: namespaces[1]) }
let_it_be(:subscription3) { create(:gitlab_subscription, :premium, namespace: namespaces[1]) }
before do
stub_ee_application_setting(elasticsearch_indexing: false)
......@@ -75,7 +75,7 @@ RSpec.describe ElasticsearchIndexedNamespace do
expect(get_indexed_namespaces).to eq([ids[0], ids[2]])
expect_queue_to_contain(ids[2], "index")
described_class.index_first_n_namespaces_of_plan('silver', 1)
described_class.index_first_n_namespaces_of_plan('premium', 1)
expect(get_indexed_namespaces).to eq([ids[0], ids[2], ids[1]])
expect_queue_to_contain(ids[1], "index")
......@@ -85,7 +85,7 @@ RSpec.describe ElasticsearchIndexedNamespace do
describe '.unindex_last_n_namespaces_of_plan' do
before do
described_class.index_first_n_namespaces_of_plan('ultimate', 2)
described_class.index_first_n_namespaces_of_plan('silver', 1)
described_class.index_first_n_namespaces_of_plan('premium', 1)
end
it 'creates records, scoped by plan and ordered by namespace id' do
......@@ -100,7 +100,7 @@ RSpec.describe ElasticsearchIndexedNamespace do
expect(get_indexed_namespaces).to contain_exactly(ids[0], ids[1])
expect_queue_to_contain(ids[2], "delete")
described_class.unindex_last_n_namespaces_of_plan('silver', 1)
described_class.unindex_last_n_namespaces_of_plan('premium', 1)
expect(get_indexed_namespaces).to contain_exactly(ids[0])
expect_queue_to_contain(ids[1], "delete")
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe GitlabSubscription do
using RSpec::Parameterized::TableSyntax
%i[free_plan bronze_plan silver_plan ultimate_plan].each do |plan|
%i[free_plan bronze_plan premium_plan ultimate_plan].each do |plan|
let_it_be(plan) { create(plan) }
end
......@@ -35,13 +35,13 @@ RSpec.describe GitlabSubscription do
describe 'scopes' do
describe '.with_hosted_plan' do
let!(:ultimate_subscription) { create(:gitlab_subscription, hosted_plan: ultimate_plan) }
let!(:silver_subscription) { create(:gitlab_subscription, hosted_plan: silver_plan) }
let!(:premium_subscription) { create(:gitlab_subscription, hosted_plan: premium_plan) }
let!(:trial_subscription) { create(:gitlab_subscription, hosted_plan: ultimate_plan, trial: true) }
it 'scopes to the plan' do
expect(described_class.with_hosted_plan('ultimate')).to contain_exactly(ultimate_subscription)
expect(described_class.with_hosted_plan('silver')).to contain_exactly(silver_subscription)
expect(described_class.with_hosted_plan('premium')).to contain_exactly(premium_subscription)
expect(described_class.with_hosted_plan('bronze')).to be_empty
end
end
......@@ -102,7 +102,7 @@ RSpec.describe GitlabSubscription do
end
context 'with other plans' do
%w[bronze silver].each do |plan|
%w[bronze premium].each do |plan|
it 'excludes these members' do
gitlab_subscription.update!(plan_code: plan)
......@@ -121,7 +121,7 @@ RSpec.describe GitlabSubscription do
end
it 'always returns 1 seat' do
[bronze_plan, silver_plan, ultimate_plan].each do |plan|
[bronze_plan, premium_plan, ultimate_plan].each do |plan|
gitlab_subscription.update!(hosted_plan: plan)
expect(gitlab_subscription.calculate_seats_in_use).to eq(1)
......@@ -302,7 +302,7 @@ RSpec.describe GitlabSubscription do
'bronze' | 0 | true | false
'bronze' | 1 | true | true
'bronze' | 1 | false | false
'silver' | 1 | true | true
'premium' | 1 | true | true
end
with_them do
......@@ -326,7 +326,7 @@ RSpec.describe GitlabSubscription do
where(:plan_name, :paid_hosted_plan, :expired, :result) do
'bronze' | true | false | true
'bronze' | true | true | false
'silver' | true | false | true
'premium' | true | false | true
'ultimate' | true | false | false
end
......
......@@ -1496,8 +1496,8 @@ RSpec.describe Project do
allow(License).to receive(:current).and_return(global_license)
allow(global_license).to receive(:features).and_return([
:subepics, # Ultimate only
:epics, # Silver and up
:push_rules, # Silver and up
:epics, # Premium and up
:push_rules, # Premium and up
:audit_events, # Bronze and up
:geo # Global feature, should not be checked at namespace level
])
......@@ -1518,10 +1518,10 @@ RSpec.describe Project do
end
end
context 'when silver' do
let(:plan_license) { :silver }
context 'when premium' do
let(:plan_license) { :premium }
it 'filters for silver features' do
it 'filters for premium features' do
is_expected.to contain_exactly(:push_rules, :audit_events, :geo, :epics)
end
end
......
......@@ -298,8 +298,8 @@ RSpec.describe PushRule do
it_behaves_like 'an unavailable push_rule'
end
context 'with a Silver plan' do
let(:plan) { :silver }
context 'with a Premium plan' do
let(:plan) { :premium }
it_behaves_like 'an available push_rule'
end
......
......@@ -409,7 +409,7 @@ RSpec.describe GroupPolicy do
before_all do
create(:license, plan: License::ULTIMATE_PLAN)
create(:gitlab_subscription, :silver, namespace: group)
create(:gitlab_subscription, :premium, namespace: group)
end
context 'without an enabled SAML provider' do
......@@ -1284,7 +1284,7 @@ RSpec.describe GroupPolicy do
end
it_behaves_like 'model with wiki policies' do
let_it_be_with_refind(:container) { create(:group_with_plan, plan: :silver_plan) }
let_it_be_with_refind(:container) { create(:group_with_plan, plan: :premium_plan) }
let_it_be(:user) { owner }
before_all do
......
......@@ -99,9 +99,9 @@ RSpec.describe API::Namespaces do
end
end
context 'when requesting silver plan' do
context 'when requesting premium plan' do
it 'counts guest members' do
get api("/namespaces?requested_hosted_plan=silver", user)
get api("/namespaces?requested_hosted_plan=premium", user)
expect(json_response.first['billable_members_count']).to eq(3)
end
......@@ -392,11 +392,11 @@ RSpec.describe API::Namespaces do
get api("/namespaces/#{namespace.id}/gitlab_subscription", current_user)
end
let_it_be(:silver_plan) { create(:silver_plan) }
let_it_be(:premium_plan) { create(:premium_plan) }
let_it_be(:owner) { create(:user) }
let_it_be(:developer) { create(:user) }
let_it_be(:namespace) { create(:group) }
let_it_be(:gitlab_subscription) { create(:gitlab_subscription, hosted_plan: silver_plan, namespace: namespace) }
let_it_be(:gitlab_subscription) { create(:gitlab_subscription, hosted_plan: premium_plan, namespace: namespace) }
before do
namespace.add_owner(owner)
......@@ -429,8 +429,8 @@ RSpec.describe API::Namespaces do
expect(json_response.keys).to match_array(%w[plan usage billing])
expect(json_response['plan'].keys).to match_array(%w[name code trial upgradable auto_renew])
expect(json_response['plan']['name']).to eq('Silver')
expect(json_response['plan']['code']).to eq('silver')
expect(json_response['plan']['name']).to eq('Premium')
expect(json_response['plan']['code']).to eq('premium')
expect(json_response['plan']['trial']).to eq(false)
expect(json_response['plan']['upgradable']).to eq(true)
expect(json_response['usage'].keys).to match_array(%w[seats_in_subscription seats_in_use max_seats_used seats_owed])
......@@ -444,14 +444,14 @@ RSpec.describe API::Namespaces do
put api("/namespaces/#{namespace_id}/gitlab_subscription", current_user), params: payload
end
let_it_be(:silver_plan) { create(:silver_plan) }
let_it_be(:premium_plan) { create(:premium_plan) }
let_it_be(:namespace) { create(:group, name: 'test.test-group.22') }
let_it_be(:gitlab_subscription) { create(:gitlab_subscription, namespace: namespace) }
let(:params) do
{
seats: 150,
plan_code: 'silver',
plan_code: 'premium',
start_date: '01/01/2018',
end_date: '01/01/2019'
}
......@@ -499,8 +499,8 @@ RSpec.describe API::Namespaces do
expect(response).to have_gitlab_http_status(:ok)
expect(gitlab_subscription.reload.seats).to eq(150)
expect(gitlab_subscription.max_seats_used).to eq(0)
expect(gitlab_subscription.plan_name).to eq('silver')
expect(gitlab_subscription.plan_title).to eq('Silver')
expect(gitlab_subscription.plan_name).to eq('premium')
expect(gitlab_subscription.plan_title).to eq('Premium')
end
it 'is successful using full_path when namespace path contains dots' do
......
......@@ -94,11 +94,11 @@ RSpec.describe Dashboard::Projects::ListService do
where(:check_namespace_plan, :plan, :available) do
true | :gold | true
true | :silver | true
true | :premium | true
true | :ultimate | true
true | nil | false
false | :gold | true
false | :silver | true
false | :premium | true
false | :ultimate | true
false | nil | true
end
......
......@@ -41,7 +41,7 @@ RSpec.shared_examples 'dashboard ultimate trial callout' do
it 'hides promotion callout if a trial is active' do
allow_any_instance_of(EE::DashboardHelper).to receive(:user_default_dashboard?).and_return(true)
group = create(:group_with_plan, name: 'trial group', plan: :silver_plan, trial_ends_on: 1.year.from_now)
group = create(:group_with_plan, name: 'trial group', plan: :premium_plan, trial_ends_on: 1.year.from_now)
group.add_owner(user)
visit page_path
......@@ -81,9 +81,9 @@ RSpec.shared_examples 'billings ultimate trial callout' do
end
context "on a plan that isn't ultimate", :js do
let(:plans) { { bronze: create(:bronze_plan), silver: create(:silver_plan) } }
let(:plans) { { bronze: create(:bronze_plan), premium: create(:premium_plan) } }
where(case_names: ->(plan_type) {"like #{plan_type}"}, plan_type: [:bronze, :silver])
where(case_names: ->(plan_type) {"like #{plan_type}"}, plan_type: [:bronze, :premium])
with_them do
let(:plan) { plans[plan_type] }
......
......@@ -53,7 +53,7 @@ RSpec.describe 'shared/billings/_eoa_bronze_plan_banner.html.haml' do
shared_examples 'with a different plan than Bronze' do
before do
allow(namespace).to receive(:actual_plan_name).and_return(::Plan::SILVER)
allow(namespace).to receive(:actual_plan_name).and_return(::Plan::PREMIUM)
end
it 'does not display the banner' do
......
......@@ -26,7 +26,7 @@ RSpec.describe 'shared/billings/_trial_status.html.haml' do
let(:trial) { true }
context 'with a ultimate trial' do
let(:plan) { create(:ultimate_plan, title: 'Ultimate') }
let(:plan) { create(:ultimate_plan) }
it 'displays expiry date and Ultimate' do
render 'shared/billings/trial_status', namespace: group
......@@ -35,13 +35,13 @@ RSpec.describe 'shared/billings/_trial_status.html.haml' do
end
end
context 'with a silver trial' do
let(:plan) { create(:gold_plan, title: 'Silver') }
context 'with a premium trial' do
let(:plan) { create(:premium_plan) }
it 'displays expiry date and Silver' do
it 'displays expiry date and Premium' do
render 'shared/billings/trial_status', namespace: group
expect(rendered).to have_content("Your GitLab.com Silver trial will expire after #{trial_ends_on}. You can retain access to the Silver features by upgrading below.")
expect(rendered).to have_content("Your GitLab.com Premium trial will expire after #{trial_ends_on}. You can retain access to the Premium features by upgrading below.")
end
end
end
......
......@@ -56,18 +56,18 @@ RSpec.describe ElasticNamespaceRolloutWorker do
it 'distinguishes different plans' do
# Rollout
subject.perform('ultimate', 50, ROLLOUT)
subject.perform('silver', 25, ROLLOUT)
subject.perform('premium', 25, ROLLOUT)
expect(
ElasticsearchIndexedNamespace.pluck(:namespace_id)
).to contain_exactly(
*get_namespace_ids(:ultimate, 2),
*get_namespace_ids(:silver, 1)
*get_namespace_ids(:premium, 1)
)
# Rollback
subject.perform('ultimate', 25, ROLLBACK)
subject.perform('silver', 0, ROLLBACK)
subject.perform('premium', 0, ROLLBACK)
expect(
ElasticsearchIndexedNamespace.pluck(:namespace_id)
......
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