Commit 9e447544 authored by Etienne Baqué's avatar Etienne Baqué

Renamed variables, constants and traits in rspecs

Renamed variables, constants and traits in rspecs
parent d7560d31
......@@ -781,7 +781,7 @@ RSpec/AnyInstanceOf:
- 'ee/spec/services/slash_commands/global_slack_handler_spec.rb'
- 'ee/spec/support/helpers/ee/stub_configuration.rb'
- 'ee/spec/support/shared_examples/controllers/analytics/cycle_analytics/shared_stage_shared_examples.rb'
- 'ee/spec/support/shared_examples/features/gold_trial_callout_shared_examples.rb'
- 'ee/spec/support/shared_examples/features/ultimate_trial_callout_shared_examples.rb'
- 'ee/spec/support/shared_examples/lib/gitlab/geo/geo_logs_event_source_info_shared_examples.rb'
- 'ee/spec/support/shared_examples/models/member_shared_examples.rb'
- 'ee/spec/support/shared_examples/services/base_sync_service_shared_examples.rb'
......
......@@ -47,7 +47,7 @@ module InProductMarketingHelper
s_('InProductMarketing|Are your runners ready?')
],
trial: [
s_('InProductMarketing|Start a free trial of GitLab Gold – no CC required'),
s_('InProductMarketing|Start a free trial of GitLab Ultimate – no CC required'),
s_('InProductMarketing|Improve app security with a 30-day trial'),
s_('InProductMarketing|Start with a GitLab Gold free trial')
],
......
......@@ -31,7 +31,7 @@ module UserCalloutsHelper
render 'shared/flash_user_callout', flash_type: flash_type, message: message, feature_name: feature_name
end
def render_dashboard_gold_trial(user)
def render_dashboard_ultimate_trial(user)
end
def render_account_recovery_regular_check
......
......@@ -7,7 +7,7 @@ class UserCallout < ApplicationRecord
gke_cluster_integration: 1,
gcp_signup_offer: 2,
cluster_security_warning: 3,
gold_trial: 4, # EE-only
ultimate_trial: 4, # EE-only
geo_enable_hashed_storage: 5, # EE-only
geo_migrate_hashed_storage: 6, # EE-only
canary_deployment: 7, # EE-only
......
......@@ -3,7 +3,7 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, dashboard_projects_url(rss_url_options), title: "All activity")
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
- page_title _("Activity")
- header_title _("Activity"), activity_dashboard_path
......
......@@ -2,7 +2,7 @@
- page_title _("Groups")
- header_title _("Groups"), dashboard_groups_path
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
= render 'dashboard/groups_head'
- if params[:filter].blank? && @groups.empty?
......
......@@ -4,7 +4,7 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{current_user.name} issues")
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
.page-title-holder.d-flex.align-items-center
%h1.page-title= _('Issues')
......
......@@ -2,7 +2,7 @@
- page_title _("Merge Requests")
- @breadcrumb_link = merge_requests_dashboard_path(assignee_username: current_user.username)
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
.page-title-holder.d-flex.align-items-start.flex-column.flex-sm-row.align-items-sm-center
%h1.page-title= _('Merge Requests')
......
......@@ -12,7 +12,7 @@
callouts_feature_id: UserCalloutsHelper::CUSTOMIZE_HOMEPAGE,
track_label: 'home_page' } }
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
- page_title _("Projects")
- header_title _("Projects"), dashboard_projects_path
......
......@@ -2,7 +2,7 @@
- breadcrumb_title _("Projects")
- header_title _("Projects"), dashboard_projects_path
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
= render "projects/last_push"
= render 'dashboard/projects_head', project_tab_filter: :starred
......
......@@ -2,7 +2,7 @@
- page_title _("To-Do List")
- header_title _("To-Do List"), dashboard_todos_path
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
- add_page_specific_style 'page_bundles/todos'
.page-title-holder.d-flex.align-items-center
......
......@@ -2,7 +2,7 @@
- page_title _("Groups")
- header_title _("Groups"), dashboard_groups_path
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
- if current_user
= render 'dashboard/groups_head'
......
......@@ -3,7 +3,7 @@
- header_title _("Projects"), dashboard_projects_path
- page_canonical_link explore_projects_url
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
- if current_user
= render 'dashboard/projects_head', project_tab_filter: :explore
......
......@@ -2,7 +2,7 @@
- page_title _("Projects")
- header_title _("Projects"), dashboard_projects_path
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
- if current_user
= render 'dashboard/projects_head', project_tab_filter: :explore
......
......@@ -2,7 +2,7 @@
- page_title _("Projects")
- header_title _("Projects"), dashboard_projects_path
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
- if current_user
= render 'dashboard/projects_head', project_tab_filter: :starred
......
......@@ -2,7 +2,7 @@
- page_title _("Projects")
- header_title _("Projects"), dashboard_projects_path
= render_dashboard_gold_trial(current_user)
= render_dashboard_ultimate_trial(current_user)
- if current_user
= render 'dashboard/projects_head', project_tab_filter: :explore_trending
......
......@@ -99,7 +99,7 @@ export default {
),
],
discoverPlanCaption: s__(
'Discover|See the other features of the %{linkStart}gold plan%{linkEnd}',
'Discover|See the other features of the %{linkStart}ultimate plan%{linkEnd}',
),
},
};
......
......@@ -45,7 +45,7 @@ module Registrations
def create_learn_gitlab_project
title, filename = if helpers.in_trial_onboarding_flow?
[s_('Learn GitLab - Ultimate trial'), 'learn_gitlab_gold_trial.tar.gz']
[s_('Learn GitLab - Ultimate trial'), 'learn_gitlab_ultimate_trial.tar.gz']
else
[s_('Learn GitLab'), 'learn_gitlab.tar.gz']
end
......
......@@ -47,7 +47,7 @@ module Mutations
if result.duplicate_project_ids.include?(project.id)
_('The project has already been added to your dashboard.')
elsif result.not_licensed_project_ids.include?(project.id)
_('Only projects created under a Gold license are available in Security Dashboards.')
_('Only projects created under a Ultimate license are available in Security Dashboards.')
else
_('Project was not found or you do not have permission to add this project to Security Dashboards.')
end
......
......@@ -8,7 +8,7 @@ module EE
ACTIVE_USER_COUNT_THRESHOLD = 'active_user_count_threshold'
GEO_ENABLE_HASHED_STORAGE = 'geo_enable_hashed_storage'
GEO_MIGRATE_HASHED_STORAGE = 'geo_migrate_hashed_storage'
GOLD_TRIAL = 'gold_trial'
ULTIMATE_TRIAL = 'ultimate_trial'
NEW_USER_SIGNUPS_CAP_REACHED = 'new_user_signups_cap_reached'
PERSONAL_ACCESS_TOKEN_EXPIRY = 'personal_access_token_expiry'
THREAT_MONITORING_INFO = 'threat_monitoring_info'
......@@ -43,14 +43,14 @@ module EE
any_project_not_in_hashed_storage?
end
override :render_dashboard_gold_trial
def render_dashboard_gold_trial(user)
return unless show_gold_trial?(user, GOLD_TRIAL) &&
override :render_dashboard_ultimate_trial
def render_dashboard_ultimate_trial(user)
return unless show_ultimate_trial?(user, ULTIMATE_TRIAL) &&
user_default_dashboard?(user) &&
!user.owns_paid_namespace? &&
user.any_namespace_without_trial?
render 'shared/gold_trial_callout_content'
render 'shared/ultimate_trial_callout_content'
end
def render_account_recovery_regular_check
......@@ -125,15 +125,15 @@ module EE
linked_message.html_safe
end
def show_gold_trial?(user, callout = GOLD_TRIAL)
def show_ultimate_trial?(user, callout = ULTIMATE_TRIAL)
return false unless user
return false unless show_gold_trial_suitable_env?
return false unless show_ultimate_trial_suitable_env?
return false if user_dismissed?(callout)
true
end
def show_gold_trial_suitable_env?
def show_ultimate_trial_suitable_env?
::Gitlab.com? && !::Gitlab::Database.read_only?
end
......
- is_dismissable = local_assigns.fetch(:is_dismissable, true)
- callout = local_assigns.fetch(:callout, UserCalloutsHelper::GOLD_TRIAL)
- callout = local_assigns.fetch(:callout, UserCalloutsHelper::ULTIMATE_TRIAL)
- button_css_class = is_dismissable ? 'mr-3' : ''
.pt-1.d-none.d-md-block{ class: container_class }
......
......@@ -102,7 +102,7 @@ module Gitlab
def expiring_features_message
case plan_name
when 'Gold'
when 'Gold', 'Ultimate'
_('After that, you will not be able to use merge approvals or epics as well as many security features.')
when 'Silver'
_('After that, you will not be able to use merge approvals or epics as well as many other features.')
......
......@@ -3,7 +3,7 @@
FactoryBot.define do
factory :gitlab_subscription do
namespace
association :hosted_plan, factory: :gold_plan
association :hosted_plan, factory: :ultimate_plan
seats { 10 }
start_date { Date.current }
end_date { Date.current.advance(years: 1) }
......
......@@ -11,7 +11,7 @@ RSpec.describe 'Billing plan pages', :feature do
let(:free_plan) { create(:free_plan) }
let(:bronze_plan) { create(:bronze_plan) }
let(:silver_plan) { create(:silver_plan) }
let(:gold_plan) { create(:gold_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|
data.deep_symbolize_keys
......@@ -201,8 +201,8 @@ RSpec.describe 'Billing plan pages', :feature do
it_behaves_like 'plan with subscription table'
end
context 'on gold plan' do
let(:plan) { gold_plan }
context 'on ultimate plan' do
let(:plan) { ultimate_plan }
let!(:subscription) do
create(:gitlab_subscription, namespace: namespace, hosted_plan: plan, seats: 15)
......@@ -279,8 +279,8 @@ RSpec.describe 'Billing plan pages', :feature do
it_behaves_like 'can contact sales'
end
context 'on gold plan' do
let(:plan) { gold_plan }
context 'on ultimate plan' do
let(:plan) { ultimate_plan }
let!(:subscription) do
create(:gitlab_subscription, namespace: namespace, hosted_plan: plan, seats: 15)
......@@ -299,8 +299,8 @@ RSpec.describe 'Billing plan pages', :feature do
context 'top-most group' do
let(:page_path) { group_billings_path(namespace) }
context 'on gold' do
let(:plan) { gold_plan }
context 'on ultimate' do
let(:plan) { ultimate_plan }
let!(:subscription) do
create(:gitlab_subscription, namespace: namespace, hosted_plan: plan, seats: 15)
......@@ -312,7 +312,7 @@ RSpec.describe 'Billing plan pages', :feature do
it 'displays plan header' do
page.within('.billing-plan-header') do
expect(page).to have_content("#{namespace.name} is currently using the Gold Plan")
expect(page).to have_content("#{namespace.name} is currently using the Ultimate Plan")
expect(page).to have_css('.billing-plan-logo .identicon')
end
......@@ -378,8 +378,8 @@ RSpec.describe 'Billing plan pages', :feature do
context 'top-most group' do
let(:page_path) { group_billings_path(namespace) }
context 'on gold' do
let(:plan) { gold_plan }
context 'on ultimate' do
let(:plan) { ultimate_plan }
let!(:subscription) do
create(:gitlab_subscription, namespace: namespace, hosted_plan: plan,
......@@ -392,7 +392,7 @@ RSpec.describe 'Billing plan pages', :feature do
it 'displays plan header' do
page.within('.billing-plan-header') do
expect(page).to have_content("#{namespace.name} is currently using the Gold Plan")
expect(page).to have_content("#{namespace.name} is currently using the Ultimate Plan")
expect(page).to have_css('.billing-plan-logo .identicon')
end
......
......@@ -30,34 +30,34 @@ RSpec.describe 'Dashboard operations', :js do
it 'masks projects without valid license' do
user = create(:user)
gold_group = create(:group)
ultimate_group = create(:group)
bronze_group = create(:group)
create(:gitlab_subscription, :gold, namespace: gold_group)
create(:gitlab_subscription, :ultimate, namespace: ultimate_group)
create(:gitlab_subscription, :bronze, namespace: bronze_group)
gold_project = create(:project, :repository, namespace: gold_group, name: 'Gold Project')
ultimate_project = create(:project, :repository, namespace: ultimate_group, name: 'Ultimate Project')
bronze_project = create(:project, :repository, namespace: bronze_group, name: 'Bronze Project')
public_project = create(:project, :repository, :public, namespace: bronze_group, name: 'Public Bronze Project')
gold_pipeline = create(:ci_pipeline, project: gold_project, sha: gold_project.commit.sha, status: :running)
ultimate_pipeline = create(:ci_pipeline, project: ultimate_project, sha: ultimate_project.commit.sha, status: :running)
bronze_pipeline = create(:ci_pipeline, project: bronze_project, sha: bronze_project.commit.sha, status: :running)
public_pipeline = create(:ci_pipeline, project: public_project, sha: public_project.commit.sha, status: :running)
gold_project.add_developer(user)
ultimate_project.add_developer(user)
bronze_group.add_developer(user)
user.update!(ops_dashboard_projects: [gold_project, bronze_project, public_project])
user.update!(ops_dashboard_projects: [ultimate_project, bronze_project, public_project])
sign_in(user)
visit operations_path
bronze_card = project_card(bronze_project)
gold_card = project_card(gold_project)
ultimate_card = project_card(ultimate_project)
public_card = project_card(public_project)
assert_masked(bronze_card, bronze_project, bronze_pipeline, bronze_group)
assert_available(gold_card, gold_project, gold_pipeline)
assert_available(ultimate_card, ultimate_project, ultimate_pipeline)
assert_available(public_card, public_project, public_pipeline)
end
......
......@@ -223,7 +223,7 @@ RSpec.describe 'Edit group settings' do
end
context 'namespace is on the proper plan' do
let(:plan) { create(:gold_plan) }
let(:plan) { create(:ultimate_plan) }
context 'when the group is a top parent group' do
let(:selected_group) { group }
......
......@@ -59,7 +59,7 @@ RSpec.describe 'Groups > Push Rules', :js do
context 'when enabled' do
it 'renders the setting checkbox' do
create(:gitlab_subscription, :gold, namespace: group)
create(:gitlab_subscription, :ultimate, namespace: group)
visit edit_group_push_rules_path(group)
......
......@@ -96,7 +96,7 @@ RSpec.describe 'Epic in issue sidebar', :js do
context 'group has license' do
before do
create(:gitlab_subscription, :gold, namespace: group)
create(:gitlab_subscription, :ultimate, namespace: group)
end
it_behaves_like 'epic in issue sidebar'
......
......@@ -361,7 +361,7 @@ RSpec.describe 'New project', :js do
before do
allow(Gitlab::CurrentSettings).to receive(:should_check_namespace_plan?) { true }
create(:gitlab_subscription, :gold, namespace: group1)
create(:gitlab_subscription, :ultimate, namespace: group1)
end
it 'show Group tab in Templates section' do
......
......@@ -33,7 +33,7 @@ RSpec.describe 'Projects > Push Rules', :js do
context 'licensed' do
let(:bronze_plan) { create(:bronze_plan) }
let(:gold_plan) { create(:gold_plan) }
let(:ultimate_plan) { create(:ultimate_plan) }
before do
stub_licensed_features(rule_attr => true)
......@@ -62,7 +62,7 @@ RSpec.describe 'Projects > Push Rules', :js do
context 'when enabled' do
it 'renders the setting checkbox' do
create(:gitlab_subscription, :gold, namespace: project.namespace)
create(:gitlab_subscription, :ultimate, namespace: project.namespace)
visit project_settings_repository_path(project)
......
......@@ -7,7 +7,7 @@ RSpec.describe 'Show trial banner', :js do
let!(:user) { create(:user) }
let!(:group) { create(:group) }
let!(:gold_plan) { create(:gold_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|
data.deep_symbolize_keys
......@@ -21,8 +21,8 @@ RSpec.describe 'Show trial banner', :js do
.to_return(status: 200, body: plans_data.to_json)
group.add_owner(user)
create(:gitlab_subscription, namespace: user.namespace, hosted_plan: gold_plan, trial: true, trial_ends_on: Date.current + 1.month)
create(:gitlab_subscription, namespace: group, hosted_plan: gold_plan, trial: true, trial_ends_on: Date.current + 1.month)
create(:gitlab_subscription, namespace: user.namespace, hosted_plan: ultimate_plan, trial: true, trial_ends_on: Date.current + 1.month)
create(:gitlab_subscription, namespace: group, hosted_plan: ultimate_plan, trial: true, trial_ends_on: Date.current + 1.month)
gitlab_sign_in(user)
end
......
......@@ -13,21 +13,21 @@ RSpec.describe ProjectsFinder do
let(:params) { { plans: plans } }
let(:project_ids_relation) { nil }
let_it_be(:gold_project) { create_project(:gold_plan) }
let_it_be(:gold_project2) { create_project(:gold_plan) }
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(:no_plan_project) { create_project(nil) }
context 'with gold plan' do
let(:plans) { ['gold'] }
context 'with ultimate plan' do
let(:plans) { ['ultimate'] }
it { is_expected.to contain_exactly(gold_project, gold_project2) }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2) }
end
context 'with multiple plans' do
let(:plans) { %w[gold silver] }
let(:plans) { %w[ultimate silver] }
it { is_expected.to contain_exactly(gold_project, gold_project2, silver_project) }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, silver_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(gold_project, gold_project2, silver_project, no_plan_project) }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, silver_project, no_plan_project) }
end
context 'with empty plans' do
let(:plans) { [] }
it { is_expected.to contain_exactly(gold_project, gold_project2, silver_project, no_plan_project) }
it { is_expected.to contain_exactly(ultimate_project, ultimate_project2, silver_project, no_plan_project) }
end
context 'filter by aimed for deletion' do
......
......@@ -195,7 +195,7 @@ RSpec.describe EpicsFinder do
.to receive(:should_check_namespace_plan?)
.and_return(true)
create(:gitlab_subscription, :gold, namespace: group)
create(:gitlab_subscription, :ultimate, namespace: group)
expect { epics.to_a }.not_to exceed_all_query_limit(6)
end
......
......@@ -39,7 +39,7 @@ RSpec.describe GroupProjectsFinder do
end
context 'when security dashboard is enabled for a group' do
let(:group) { create(:group_with_plan, plan: :gold_plan) } # overriding group from 'GroupProjectsFinder context'
let(:group) { create(:group_with_plan, plan: :ultimate_plan) } # overriding group from 'GroupProjectsFinder context'
before do
stub_licensed_features(security_dashboard: true)
......
......@@ -22,7 +22,7 @@ RSpec.describe GroupsWithTemplatesFinder do
create(:project, namespace: subgroup_1)
create(:project, namespace: subgroup_2)
create(:project, namespace: subgroup_3)
create(:gitlab_subscription, :gold, namespace: group_1)
create(:gitlab_subscription, :ultimate, namespace: group_1)
create(:gitlab_subscription, :silver, namespace: group_2)
end
......@@ -36,7 +36,7 @@ RSpec.describe GroupsWithTemplatesFinder do
allow(Gitlab::CurrentSettings).to receive(:should_check_namespace_plan?) { true }
end
it 'returns groups on gold/silver plan' do
it 'returns groups on ultimate/silver 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 gold/silver plan' do
it 'returns groups on ultimate/silver plan' do
expect(described_class.new.execute).to contain_exactly(group_1, group_2, subgroup_4)
end
end
......
......@@ -129,9 +129,9 @@
}
},
{
"id": "gold-external-id",
"id": "ultimate-external-id",
"about_page_href": "https://about.gitlab.com/gitlab-com/",
"code": "gold",
"code": "ultimate",
"features": [
{
"highlight": false,
......@@ -159,12 +159,12 @@
}
],
"free": false,
"name": "Gold Plan",
"name": "Ultimate Plan",
"price_per_month": 99.0,
"price_per_year": 1188.0,
"purchase_link": {
"action": "upgrade",
"href": "http://customers.gitlab.com/subscriptions/new?plan_id=2c92a0fc5a83f01d015aa6db83c45aac"
"href": "http://customers.gitlab.com/subscriptions/new?plan_id=2c92a0ff76f0d5250176f2f8c86f305a"
}
}
]
......@@ -43,7 +43,7 @@ RSpec.describe Mutations::InstanceSecurityDashboard::AddProject do
it 'does not add project to the security dashboard', :aggregate_failures do
expect(subject[:project]).to be_nil
expect(subject[:errors]).to include('Only projects created under a Gold license are available in Security Dashboards.')
expect(subject[:errors]).to include('Only projects created under a Ultimate license are available in Security Dashboards.')
expect(user.security_dashboard_projects).to include(already_added_project)
end
end
......
......@@ -422,14 +422,14 @@ RSpec.describe BillingPlansHelper do
describe '#subscription_plan_info' do
it 'returns the current plan' do
other_plan = Hashie::Mash.new(code: 'bronze')
current_plan = Hashie::Mash.new(code: 'gold')
current_plan = Hashie::Mash.new(code: 'ultimate')
expect(helper.subscription_plan_info([other_plan, current_plan], 'gold')).to eq(current_plan)
expect(helper.subscription_plan_info([other_plan, current_plan], 'ultimate')).to eq(current_plan)
end
it 'returns nil if no plan matches the code' do
plan_a = Hashie::Mash.new(code: 'bronze')
plan_b = Hashie::Mash.new(code: 'gold')
plan_b = Hashie::Mash.new(code: 'ultimate')
expect(helper.subscription_plan_info([plan_a, plan_b], 'default')).to be_nil
end
......
......@@ -132,12 +132,12 @@ RSpec.describe EE::UserCalloutsHelper do
end
end
describe '#render_dashboard_gold_trial' do
describe '#render_dashboard_ultimate_trial' do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:gold_plan) { create(:gold_plan) }
let_it_be(:ultimate_plan) { create(:ultimate_plan) }
let(:user) { namespace.owner }
where(:any_namespace_without_trial?, :show_gold_trial?, :user_default_dashboard?, :has_no_trial_or_paid_plan?, :should_render?) do
where(:any_namespace_without_trial?, :show_ultimate_trial?, :user_default_dashboard?, :has_no_trial_or_paid_plan?, :should_render?) do
true | true | true | true | true
true | true | true | false | false
true | true | false | true | false
......@@ -158,23 +158,23 @@ RSpec.describe EE::UserCalloutsHelper do
with_them do
before do
allow(helper).to receive(:show_gold_trial?) { show_gold_trial? }
allow(helper).to receive(:show_ultimate_trial?) { show_ultimate_trial? }
allow(helper).to receive(:user_default_dashboard?) { user_default_dashboard? }
allow(user).to receive(:any_namespace_without_trial?) { any_namespace_without_trial? }
unless has_no_trial_or_paid_plan?
create(:gitlab_subscription, hosted_plan: gold_plan, namespace: namespace)
create(:gitlab_subscription, hosted_plan: ultimate_plan, namespace: namespace)
end
end
it do
if should_render?
expect(helper).to receive(:render).with('shared/gold_trial_callout_content')
expect(helper).to receive(:render).with('shared/ultimate_trial_callout_content')
else
expect(helper).not_to receive(:render)
end
helper.render_dashboard_gold_trial(user)
helper.render_dashboard_ultimate_trial(user)
end
end
end
......
......@@ -69,7 +69,7 @@ RSpec.describe TrialStatusWidgetHelper do
subscription.trial_ends_on = Date.current
end
it { is_expected.to eq('Gold Trial – 0 days left') }
it { is_expected.to eq('Ultimate Trial – 0 days left') }
end
context 'when there is 1 day remaining' do
......@@ -77,7 +77,7 @@ RSpec.describe TrialStatusWidgetHelper do
subscription.trial_ends_on = Date.current.advance(days: 1)
end
it { is_expected.to eq('Gold Trial – 1 day left') }
it { is_expected.to eq('Ultimate Trial – 1 day left') }
end
context 'when there are 2+ days remaining' do
......@@ -85,7 +85,7 @@ RSpec.describe TrialStatusWidgetHelper do
subscription.trial_ends_on = Date.current.advance(days: 13)
end
it { is_expected.to eq('Gold Trial – 13 days left') }
it { is_expected.to eq('Ultimate Trial – 13 days left') }
end
end
end
......@@ -5,9 +5,9 @@ require 'spec_helper'
RSpec.describe EE::Gitlab::Ci::Pipeline::Quota::Activity do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project, reload: true) { create(:project, namespace: namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
let(:plan_limits) { create(:plan_limits, plan: gold_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan) }
let_it_be(:ultimate_plan, reload: true) { create(:ultimate_plan) }
let(:plan_limits) { create(:plan_limits, plan: ultimate_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) }
subject { described_class.new(namespace, project) }
......
......@@ -5,9 +5,9 @@ require 'spec_helper'
RSpec.describe EE::Gitlab::Ci::Pipeline::Quota::JobActivity do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:project, reload: true) { create(:project, namespace: namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
let_it_be(:plan_limits, reload: true) { create(:plan_limits, plan: gold_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan) }
let_it_be(:ultimate_plan, reload: true) { create(:ultimate_plan) }
let_it_be(:plan_limits, reload: true) { create(:plan_limits, plan: ultimate_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) }
subject { described_class.new(namespace, project) }
......
......@@ -4,10 +4,10 @@ require 'spec_helper'
RSpec.describe EE::Gitlab::Ci::Pipeline::Quota::Size do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
let_it_be(:ultimate_plan, reload: true) { create(:ultimate_plan) }
let_it_be(:project, reload: true) { create(:project, :repository, namespace: namespace) }
let_it_be(:plan_limits) { create(:plan_limits, plan: gold_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan) }
let_it_be(:plan_limits) { create(:plan_limits, plan: ultimate_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) }
let(:pipeline) { build_stubbed(:ci_pipeline, project: project) }
......
......@@ -10,11 +10,11 @@ RSpec.describe Gitlab::HookData::GroupMemberBuilder do
context 'data' do
context 'group_plan attribute' do
let(:group) { create(:group_with_plan, plan: :gold_plan) }
let(:group) { create(:group_with_plan, plan: :ultimate_plan) }
it 'returns correct group_plan' do
expect(data).to include(:group_plan)
expect(data[:group_plan]).to eq('gold')
expect(data[:group_plan]).to eq('ultimate')
end
end
end
......
......@@ -21,9 +21,9 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::Activity do
context 'when active pipelines limit is exceeded' do
before do
gold_plan = create(:gold_plan)
create(:plan_limits, plan: gold_plan, ci_active_pipelines: 1)
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
ultimate_plan = create(:ultimate_plan)
create(:plan_limits, plan: ultimate_plan, ci_active_pipelines: 1)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
create(:ci_pipeline, project: project, status: 'pending')
create(:ci_pipeline, project: project, status: 'running')
......@@ -65,9 +65,9 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::Activity do
context 'when pipeline activity limit is not exceeded' do
before do
gold_plan = create(:gold_plan)
create(:plan_limits, plan: gold_plan, ci_active_pipelines: 100)
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
ultimate_plan = create(:ultimate_plan)
create(:plan_limits, plan: ultimate_plan, ci_active_pipelines: 100)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
end
it 'does not break the chain' do
......
......@@ -21,9 +21,9 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::JobActivity do
context 'when active jobs limit is exceeded' do
before do
gold_plan = create(:gold_plan)
create(:plan_limits, plan: gold_plan, ci_active_jobs: 2)
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
ultimate_plan = create(:ultimate_plan)
create(:plan_limits, plan: ultimate_plan, ci_active_jobs: 2)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
pipeline = create(:ci_pipeline, project: project, status: 'running', created_at: Time.now)
create(:ci_build, pipeline: pipeline)
......@@ -67,9 +67,9 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::JobActivity do
context 'when job activity limit is not exceeded' do
before do
gold_plan = create(:gold_plan)
create(:plan_limits, plan: gold_plan, ci_active_jobs: 100)
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
ultimate_plan = create(:ultimate_plan)
create(:plan_limits, plan: ultimate_plan, ci_active_jobs: 100)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
end
it 'does not break the chain' do
......
......@@ -22,9 +22,9 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::Size do
context 'when pipeline size limit is exceeded' do
before do
gold_plan = create(:gold_plan)
create(:plan_limits, plan: gold_plan, ci_pipeline_size: 1)
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
ultimate_plan = create(:ultimate_plan)
create(:plan_limits, plan: ultimate_plan, ci_pipeline_size: 1)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
end
context 'when saving incomplete pipelines' do
......@@ -102,9 +102,9 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Limit::Size do
context 'when pipeline size limit is not exceeded' do
before do
gold_plan = create(:gold_plan)
create(:plan_limits, plan: gold_plan, ci_pipeline_size: 100)
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
ultimate_plan = create(:ultimate_plan)
create(:plan_limits, plan: ultimate_plan, ci_pipeline_size: 100)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
end
it 'does not break the chain' do
......
......@@ -182,12 +182,18 @@ RSpec.describe Gitlab::ExpiringSubscriptionMessage do
end
context 'with namespace' do
using RSpec::Parameterized::TableSyntax
let(:namespace) { double(:namespace, name: 'No Limit Records') }
it 'has gold plan specific messaging' do
allow(subscribable).to receive(:plan).and_return('gold')
where plan: %w(gold ultimate)
with_them do
it 'has plan specific messaging' do
allow(subscribable).to receive(:plan).and_return(plan)
expect(subject).to include('Your Gold 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 security features.')
expect(subject).to include("Your #{plan.capitalize} 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 security features.")
end
end
it 'has silver plan specific messaging' do
......
......@@ -7,9 +7,9 @@ RSpec.describe EE::Namespace::RootStorageSize do
let(:current_size) { 50.megabytes }
let(:model) { described_class.new(namespace) }
let(:create_statistics) { create(:namespace_root_storage_statistics, namespace: namespace, storage_size: current_size)}
let_it_be(:gold_plan, reload: true) { create(:gold_plan) }
let_it_be(:plan_limits, reload: true) { create(:plan_limits, plan: gold_plan, storage_size_limit: 100) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan) }
let_it_be(:ultimate_plan, reload: true) { create(:ultimate_plan) }
let_it_be(:plan_limits, reload: true) { create(:plan_limits, plan: ultimate_plan, storage_size_limit: 100) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) }
before do
create_statistics
......
......@@ -12,7 +12,7 @@ RSpec.describe Namespace do
let(:free_plan) { create(:free_plan) }
let!(:bronze_plan) { create(:bronze_plan) }
let!(:silver_plan) { create(:silver_plan) }
let!(:gold_plan) { create(:gold_plan) }
let!(:ultimate_plan) { create(:ultimate_plan) }
it { is_expected.to have_one(:namespace_statistics) }
it { is_expected.to have_one(:namespace_limit) }
......@@ -166,10 +166,10 @@ RSpec.describe Namespace do
end
context 'when there is a subscription' do
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan_id: gold_plan.id) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan_id: ultimate_plan.id) }
it 'returns namespace with subscription set' do
is_expected.to eq(gold_plan.id)
is_expected.to eq(ultimate_plan.id)
end
end
end
......@@ -264,7 +264,7 @@ RSpec.describe Namespace do
end
end
context 'in active trial gold plan' do
context 'in active trial ultimate plan' do
using RSpec::Parameterized::TableSyntax
where(:plan_name) do
......@@ -468,7 +468,7 @@ RSpec.describe Namespace do
end
context 'when feature available on the plan' do
let(:hosted_plan) { create(:gold_plan) }
let(:hosted_plan) { create(:ultimate_plan) }
context 'when feature available for current group' do
it 'returns true' do
......@@ -597,7 +597,7 @@ RSpec.describe Namespace do
end
context 'when subscription plan is defined in the system' do
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) }
context 'when limits are not set for the plan' do
it_behaves_like 'uses an implied configuration'
......@@ -606,7 +606,7 @@ RSpec.describe Namespace do
context 'when limits are set for the plan' do
let!(:subscription_limits) do
create(:plan_limits,
plan: gold_plan,
plan: ultimate_plan,
ci_active_pipelines: 5,
ci_pipeline_size: 6,
ci_active_jobs: 7)
......@@ -704,14 +704,14 @@ RSpec.describe Namespace do
context 'when namespace has a subscription associated' do
before do
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan, start_date: start_date)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan, start_date: start_date)
end
context 'when this subscription was purchased before EoA rollout (legacy)' do
let(:start_date) { GitlabSubscription::EOA_ROLLOUT_DATE.to_date - 3.days }
it 'returns the legacy plan from the subscription' do
expect(namespace.actual_plan).to eq(gold_plan)
expect(namespace.actual_plan).to eq(ultimate_plan)
expect(namespace.gitlab_subscription).to be_present
end
end
......@@ -759,11 +759,11 @@ RSpec.describe Namespace do
context 'when namespace has a subscription associated' do
before do
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
end
it 'returns the plan from the subscription' do
expect(subgroup.actual_plan).to eq(gold_plan)
expect(subgroup.actual_plan).to eq(ultimate_plan)
expect(subgroup.gitlab_subscription).not_to be_present
end
end
......@@ -786,11 +786,11 @@ RSpec.describe Namespace do
context 'when namespace has a subscription associated' do
before do
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
end
it 'returns an associated plan name' do
expect(namespace.actual_plan_name).to eq 'gold'
expect(namespace.actual_plan_name).to eq 'ultimate'
end
end
......@@ -805,11 +805,11 @@ RSpec.describe Namespace do
context 'when namespace has a subscription associated' do
before do
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
end
it 'returns an associated plan name' do
expect(subgroup.actual_plan_name).to eq 'gold'
expect(subgroup.actual_plan_name).to eq 'ultimate'
end
end
......@@ -850,9 +850,9 @@ RSpec.describe Namespace do
group.add_guest(guest)
end
context 'with a gold plan' do
context 'with a ultimate plan' do
before do
create(:gitlab_subscription, namespace: group, hosted_plan: gold_plan)
create(:gitlab_subscription, namespace: group, hosted_plan: ultimate_plan)
end
it 'does not include guest users and only active users' do
......@@ -1068,9 +1068,9 @@ RSpec.describe Namespace do
group.add_guest(create(:user))
end
context 'with a gold plan' do
context 'with a ultimate plan' do
before do
create(:gitlab_subscription, namespace: group, hosted_plan: gold_plan)
create(:gitlab_subscription, namespace: group, hosted_plan: ultimate_plan)
end
it 'does not count guest users and counts only active users' do
......
......@@ -509,11 +509,11 @@ RSpec.describe User do
context 'when namespace plan is checked' do
before do
create(:gitlab_subscription, namespace: group_1, hosted_plan: create(:bronze_plan))
create(:gitlab_subscription, namespace: group_2, hosted_plan: create(:gold_plan))
create(:gitlab_subscription, namespace: group_2, hosted_plan: create(:ultimate_plan))
allow(Gitlab::CurrentSettings).to receive(:should_check_namespace_plan?) { true }
end
it 'returns groups on gold or silver plans' do
it 'returns groups on ultimate or silver plans' do
groups = user.available_subgroups_with_custom_project_templates
expect(groups.size).to eq(1)
......@@ -876,9 +876,9 @@ RSpec.describe User do
it { is_expected.to be_falsey }
end
context 'when namespace is on a gold plan' do
context 'when namespace is on a ultimate plan' do
before do
create(:gitlab_subscription, namespace: namespace.root_ancestor, hosted_plan: create(:gold_plan))
create(:gitlab_subscription, namespace: namespace.root_ancestor, hosted_plan: create(:ultimate_plan))
end
context 'user is a guest' do
......@@ -920,7 +920,7 @@ RSpec.describe User do
end
end
context 'when namespace is on a plan that is not free or gold' 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))
end
......@@ -1007,7 +1007,7 @@ RSpec.describe User do
let_it_be(:free_group_z) { create(:group, name: 'AZ', gitlab_subscription: create(:gitlab_subscription, :free)) }
let_it_be(:free_group_a) { create(:group, name: 'AA', gitlab_subscription: create(:gitlab_subscription, :free)) }
let_it_be(:sub_group) { create(:group, name: 'SubGroup', parent: free_group_a) }
let_it_be(:trial_group) { create(:group, name: 'AB', gitlab_subscription: create(:gitlab_subscription, :active_trial, :gold)) }
let_it_be(:trial_group) { create(:group, name: 'AB', gitlab_subscription: create(:gitlab_subscription, :active_trial, :ultimate)) }
subject { user.manageable_groups_eligible_for_subscription }
......@@ -1187,7 +1187,7 @@ RSpec.describe User do
allow(Gitlab::CurrentSettings)
.to receive(:should_check_namespace_plan?)
.and_return(true)
create(:gitlab_subscription, :gold, namespace: minimal_access_group)
create(:gitlab_subscription, :ultimate, namespace: minimal_access_group)
create(:group_member, :minimal_access, user: user, source: create(:group))
end
......@@ -1221,7 +1221,7 @@ RSpec.describe User do
context 'paid namespaces' do
let_it_be(:user) { create(:user) }
let_it_be(:gold_group) { create(:group_with_plan, plan: :gold_plan) }
let_it_be(:ultimate_group) { create(:group_with_plan, plan: :ultimate_plan) }
let_it_be(:bronze_group) { create(:group_with_plan, plan: :bronze_plan) }
let_it_be(:free_group) { create(:group_with_plan, plan: :free_plan) }
let_it_be(:group_without_plan) { create(:group) }
......@@ -1229,7 +1229,7 @@ RSpec.describe User do
describe '#has_paid_namespace?' do
context 'when the user has Reporter or higher on at least one paid group' do
it 'returns true' do
gold_group.add_reporter(user)
ultimate_group.add_reporter(user)
bronze_group.add_guest(user)
expect(user.has_paid_namespace?).to eq(true)
......@@ -1238,7 +1238,7 @@ RSpec.describe User do
context 'when the user is only a Guest on paid groups' do
it 'returns false' do
gold_group.add_guest(user)
ultimate_group.add_guest(user)
bronze_group.add_guest(user)
free_group.add_owner(user)
......@@ -1258,7 +1258,7 @@ RSpec.describe User do
describe '#owns_paid_namespace?' do
context 'when the user is an owner of at least one paid group' do
it 'returns true' do
gold_group.add_owner(user)
ultimate_group.add_owner(user)
bronze_group.add_owner(user)
expect(user.owns_paid_namespace?).to eq(true)
......@@ -1267,7 +1267,7 @@ RSpec.describe User do
context 'when the user is only a Maintainer on paid groups' do
it 'returns false' do
gold_group.add_maintainer(user)
ultimate_group.add_maintainer(user)
bronze_group.add_maintainer(user)
free_group.add_owner(user)
......@@ -1503,7 +1503,7 @@ RSpec.describe User do
where(:hosted_plan, :result) do
:bronze_plan | true
:silver_plan | true
:gold_plan | false
:ultimate_plan | false
:free_plan | false
:default_plan | false
end
......@@ -1527,10 +1527,10 @@ RSpec.describe User do
expect(subject).to be false
end
it 'returns false when the user has multiple groups and any group has gold' 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: :gold_plan).add_owner(user)
create(:group_with_plan, plan: :ultimate_plan).add_owner(user)
user.namespace.plans.reload
......
......@@ -65,12 +65,12 @@ RSpec.describe ElasticsearchIndexedNamespace do
ids = namespaces.map(&:id)
described_class.index_first_n_namespaces_of_plan('gold', 1)
described_class.index_first_n_namespaces_of_plan('ultimate', 1)
expect(get_indexed_namespaces).to eq([ids[0]])
expect_queue_to_contain(ids[0], "index")
described_class.index_first_n_namespaces_of_plan('gold', 2)
described_class.index_first_n_namespaces_of_plan('ultimate', 2)
expect(get_indexed_namespaces).to eq([ids[0], ids[2]])
expect_queue_to_contain(ids[2], "index")
......@@ -84,7 +84,7 @@ RSpec.describe ElasticsearchIndexedNamespace do
describe '.unindex_last_n_namespaces_of_plan' do
before do
described_class.index_first_n_namespaces_of_plan('gold', 2)
described_class.index_first_n_namespaces_of_plan('ultimate', 2)
described_class.index_first_n_namespaces_of_plan('silver', 1)
end
......@@ -95,7 +95,7 @@ RSpec.describe ElasticsearchIndexedNamespace do
expect(get_indexed_namespaces).to contain_exactly(ids[0], ids[2], ids[1])
described_class.unindex_last_n_namespaces_of_plan('gold', 1)
described_class.unindex_last_n_namespaces_of_plan('ultimate', 1)
expect(get_indexed_namespaces).to contain_exactly(ids[0], ids[1])
expect_queue_to_contain(ids[2], "delete")
......@@ -105,7 +105,7 @@ RSpec.describe ElasticsearchIndexedNamespace do
expect(get_indexed_namespaces).to contain_exactly(ids[0])
expect_queue_to_contain(ids[1], "delete")
described_class.unindex_last_n_namespaces_of_plan('gold', 1)
described_class.unindex_last_n_namespaces_of_plan('ultimate', 1)
expect(get_indexed_namespaces).to be_empty
expect_queue_to_contain(ids[0], "delete")
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe GitlabSubscription do
using RSpec::Parameterized::TableSyntax
%i[free_plan bronze_plan silver_plan gold_plan].each do |plan|
%i[free_plan bronze_plan silver_plan ultimate_plan].each do |plan|
let_it_be(plan) { create(plan) }
end
......@@ -34,13 +34,13 @@ RSpec.describe GitlabSubscription do
describe 'scopes' do
describe '.with_hosted_plan' do
let!(:gold_subscription) { create(:gitlab_subscription, hosted_plan: gold_plan) }
let!(:ultimate_subscription) { create(:gitlab_subscription, hosted_plan: ultimate_plan) }
let!(:silver_subscription) { create(:gitlab_subscription, hosted_plan: silver_plan) }
let!(:trial_subscription) { create(:gitlab_subscription, hosted_plan: gold_plan, trial: true) }
let!(:trial_subscription) { create(:gitlab_subscription, hosted_plan: ultimate_plan, trial: true) }
it 'scopes to the plan' do
expect(described_class.with_hosted_plan('gold')).to contain_exactly(gold_subscription)
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('bronze')).to be_empty
end
......@@ -93,9 +93,9 @@ RSpec.describe GitlabSubscription do
group.add_guest(user_1)
end
context 'with a gold plan' do
context 'with a ultimate plan' do
it 'excludes these members' do
gitlab_subscription.update!(plan_code: 'gold')
gitlab_subscription.update!(plan_code: 'ultimate')
expect(gitlab_subscription.calculate_seats_in_use).to eq(0)
end
......@@ -121,7 +121,7 @@ RSpec.describe GitlabSubscription do
end
it 'always returns 1 seat' do
[bronze_plan, silver_plan, gold_plan].each do |plan|
[bronze_plan, silver_plan, ultimate_plan].each do |plan|
gitlab_subscription.update!(hosted_plan: plan)
expect(gitlab_subscription.calculate_seats_in_use).to eq(1)
......@@ -222,7 +222,7 @@ RSpec.describe GitlabSubscription do
subject { gitlab_subscription.seats_in_use }
context 'with a paid hosted plan' do
let(:hosted_plan) { gold_plan }
let(:hosted_plan) { ultimate_plan }
it 'returns the previously calculated seats in use' do
expect(subject).to eq(5)
......@@ -238,7 +238,7 @@ RSpec.describe GitlabSubscription do
end
context 'with a trial plan' do
let(:hosted_plan) { gold_plan }
let(:hosted_plan) { ultimate_plan }
let(:trial) { true }
it 'returns the current seats in use' do
......@@ -324,10 +324,10 @@ RSpec.describe GitlabSubscription do
let(:subscription) { build(:gitlab_subscription) }
where(:plan_name, :paid_hosted_plan, :expired, :result) do
'bronze' | true | false | true
'bronze' | true | true | false
'silver' | true | false | true
'gold' | true | false | false
'bronze' | true | false | true
'bronze' | true | true | false
'silver' | true | false | true
'ultimate' | true | false | false
end
with_them do
......
......@@ -254,7 +254,7 @@ RSpec.describe GroupMember do
end
context 'group member webhooks', :sidekiq_inline do
let_it_be(:group) { create(:group_with_plan, plan: :gold_plan) }
let_it_be(:group) { create(:group_with_plan, plan: :ultimate_plan) }
let_it_be(:group_hook) { create(:group_hook, group: group, member_events: true) }
let_it_be(:user) { create(:user) }
......@@ -361,7 +361,7 @@ RSpec.describe GroupMember do
end
context 'group member welcome email', :sidekiq_inline do
let_it_be(:group) { create(:group_with_plan, plan: :gold_plan) }
let_it_be(:group) { create(:group_with_plan, plan: :ultimate_plan) }
let(:user) { create(:user) }
context 'when user is provisioned by group' do
......@@ -406,7 +406,7 @@ RSpec.describe GroupMember do
user_id: group_member.user.id,
group_access: group_member.human_access,
expires_at: group_member.expires_at&.xmlschema,
group_plan: 'gold',
group_plan: 'ultimate',
event_name: event
}.to_json
}
......
......@@ -649,7 +649,7 @@ RSpec.describe Group do
end
it 'returns true for groups in proper plan' do
create(:gitlab_subscription, namespace: group, hosted_plan: create(:gold_plan))
create(:gitlab_subscription, namespace: group, hosted_plan: create(:ultimate_plan))
is_expected.to be true
end
......
......@@ -861,7 +861,7 @@ RSpec.describe Project do
context 'allowed by Plan License AND Global License' do
let(:allowed_on_global_license) { true }
let(:plan_license) { build(:gold_plan) }
let(:plan_license) { build(:ultimate_plan) }
before do
allow(namespace).to receive(:plans) { [plan_license] }
......@@ -905,7 +905,7 @@ RSpec.describe Project do
context 'not allowed by Global License' do
let(:allowed_on_global_license) { false }
let(:plan_license) { build(:gold_plan) }
let(:plan_license) { build(:ultimate_plan) }
it 'returns false' do
is_expected.to eq(false)
......@@ -1495,7 +1495,7 @@ RSpec.describe Project do
before do
allow(License).to receive(:current).and_return(global_license)
allow(global_license).to receive(:features).and_return([
:subepics, # Gold only
:subepics, # Ultimate only
:epics, # Silver and up
:push_rules, # Silver and up
:audit_events, # Bronze and up
......@@ -1526,10 +1526,10 @@ RSpec.describe Project do
end
end
context 'when gold' do
let(:plan_license) { :gold }
context 'when ultimate' do
let(:plan_license) { :ultimate }
it 'filters for gold features' do
it 'filters for ultimate features' do
is_expected.to contain_exactly(:epics, :push_rules, :audit_events, :geo, :subepics)
end
end
......
......@@ -304,8 +304,8 @@ RSpec.describe PushRule do
it_behaves_like 'an available push_rule'
end
context 'with a Gold plan' do
let(:plan) { :gold }
context 'with a Ultimate plan' do
let(:plan) { :ultimate }
it_behaves_like 'an available push_rule'
end
......
......@@ -9,7 +9,7 @@ RSpec.describe SubscriptionPresenter do
describe '#plan' do
subject { presenter.plan }
it { is_expected.to eq('gold') }
it { is_expected.to eq('ultimate') }
end
describe '#notify_admins?' do
......
......@@ -11,9 +11,9 @@ RSpec.describe API::ElasticsearchIndexedNamespaces do
using RSpec::Parameterized::TableSyntax
where(:percentage, :plan) do
-1 | 'gold'
101 | 'gold'
nil | 'gold'
-1 | 'ultimate'
101 | 'ultimate'
nil | 'ultimate'
1 | nil
1 | 'foobar'
end
......@@ -27,7 +27,7 @@ RSpec.describe API::ElasticsearchIndexedNamespaces do
end
it 'prohibits non-admin' do
put api(path, non_admin), params: { plan: 'gold', percentage: 50 }
put api(path, non_admin), params: { plan: 'ultimate', percentage: 50 }
expect(response).to have_gitlab_http_status(:forbidden)
end
end
......@@ -38,9 +38,9 @@ RSpec.describe API::ElasticsearchIndexedNamespaces do
include_context 'rollout related'
it 'invokes ElasticNamespaceRolloutWorker rollout' do
expect(ElasticNamespaceRolloutWorker).to receive(:perform_async).with('gold', 50, ElasticNamespaceRolloutWorker::ROLLOUT)
expect(ElasticNamespaceRolloutWorker).to receive(:perform_async).with('ultimate', 50, ElasticNamespaceRolloutWorker::ROLLOUT)
put api(path, admin), params: { plan: 'gold', percentage: 50 }
put api(path, admin), params: { plan: 'ultimate', percentage: 50 }
expect(response).to have_gitlab_http_status(:ok)
end
......@@ -52,9 +52,9 @@ RSpec.describe API::ElasticsearchIndexedNamespaces do
include_context 'rollout related'
it 'invokes ElasticNamespaceRolloutWorker rollback' do
expect(ElasticNamespaceRolloutWorker).to receive(:perform_async).with('gold', 50, ElasticNamespaceRolloutWorker::ROLLBACK)
expect(ElasticNamespaceRolloutWorker).to receive(:perform_async).with('ultimate', 50, ElasticNamespaceRolloutWorker::ROLLBACK)
put api(path, admin), params: { plan: 'gold', percentage: 50 }
put api(path, admin), params: { plan: 'ultimate', percentage: 50 }
expect(response).to have_gitlab_http_status(:ok)
end
......
......@@ -519,7 +519,7 @@ RSpec.describe API::Groups do
subject { get api("/groups/#{group.id}/projects", user), params: { with_security_reports: true } }
context 'when security dashboard is enabled for a group' do
let(:group) { create(:group_with_plan, plan: :gold_plan) } # overriding group from parent context
let(:group) { create(:group_with_plan, plan: :ultimate_plan) } # overriding group from parent context
before do
stub_licensed_features(security_dashboard: true)
......
......@@ -8,7 +8,7 @@ RSpec.describe API::Namespaces do
let_it_be(:group1, reload: true) { create(:group, name: 'test.test-group.2') }
let_it_be(:group2) { create(:group, :nested) }
let_it_be(:gold_plan) { create(:gold_plan) }
let_it_be(:ultimate_plan) { create(:ultimate_plan) }
describe "GET /namespaces" do
context "when authenticated as admin" do
......@@ -272,7 +272,7 @@ RSpec.describe API::Namespaces do
{
start_date: '2019-06-01',
end_date: '2020-06-01',
plan_code: 'gold',
plan_code: 'ultimate',
seats: 20,
max_seats_used: 10,
auto_renew: true,
......
......@@ -176,13 +176,13 @@ RSpec.describe API::Users do
context 'when authenticated' do
context 'as an admin' do
context 'and user has a plan' do
let!(:subscription) { create(:gitlab_subscription, :gold, namespace: user.namespace) }
let!(:subscription) { create(:gitlab_subscription, :ultimate, namespace: user.namespace) }
context 'and user is not a trial user' do
it 'contains plan and trial' do
get api("/users/#{user.id}", admin)
expect(json_response).to include('plan' => 'gold', 'trial' => false)
expect(json_response).to include('plan' => 'ultimate', 'trial' => false)
end
end
......@@ -194,7 +194,7 @@ RSpec.describe API::Users do
it 'contains plan and trial' do
get api("/users/#{user.id}", admin)
expect(json_response).to include('plan' => 'gold', 'trial' => true)
expect(json_response).to include('plan' => 'ultimate', 'trial' => true)
end
end
end
......
......@@ -4,8 +4,8 @@ require 'spec_helper'
RSpec.describe Ci::CreatePipelineService, '#execute' do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:gold_plan) { create(:gold_plan) }
let_it_be(:plan_limits) { create(:plan_limits, plan: gold_plan) }
let_it_be(:ultimate_plan) { create(:ultimate_plan) }
let_it_be(:plan_limits) { create(:plan_limits, plan: ultimate_plan) }
let_it_be(:project, reload: true) { create(:project, :repository, namespace: namespace) }
let_it_be(:user) { create(:user) }
let(:ref_name) { 'master' }
......@@ -20,7 +20,7 @@ RSpec.describe Ci::CreatePipelineService, '#execute' do
end
before do
create(:gitlab_subscription, namespace: namespace, hosted_plan: gold_plan)
create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan)
project.add_developer(user)
stub_ci_pipeline_to_return_yaml_file
......
......@@ -64,7 +64,7 @@ RSpec.describe Dashboard::Projects::ListService do
before do
stub_application_setting(check_namespace_plan: true)
create(:gitlab_subscription, :gold, namespace: namespace)
create(:gitlab_subscription, :ultimate, namespace: namespace)
end
where(:plan, :trial, :expired, :available) do
......@@ -93,12 +93,14 @@ RSpec.describe Dashboard::Projects::ListService do
using RSpec::Parameterized::TableSyntax
where(:check_namespace_plan, :plan, :available) do
true | :gold | true
true | :silver | true
true | nil | false
false | :gold | true
false | :silver | true
false | nil | true
true | :gold | true
true | :silver | true
true | :ultimate | true
true | nil | false
false | :gold | true
false | :silver | true
false | :ultimate | true
false | nil | true
end
with_them do
......
......@@ -12,11 +12,11 @@ RSpec.describe EE::SystemHooksService do
it { expect(event_data(group_member, :destroy)).to include(:event_name, :created_at, :updated_at, :group_name, :group_path, :group_plan, :group_id, :user_name, :user_username, :user_email, :user_id, :group_access) }
end
context 'with a Gold plan' do
let(:group) { create(:group_with_plan, plan: :gold_plan) }
context 'with a Ultimate plan' do
let(:group) { create(:group_with_plan, plan: :ultimate_plan) }
it 'returns correct group_plan' do
expect(event_data(group_member, :create)[:group_plan]).to eq('gold')
expect(event_data(group_member, :create)[:group_plan]).to eq('ultimate')
end
end
end
......
......@@ -146,7 +146,7 @@ RSpec.describe Projects::CreateService, '#execute' do
context 'when licensed on a namespace' do
it 'allows enabling mirrors' do
create(:gitlab_subscription, :gold, namespace: user.namespace)
create(:gitlab_subscription, :ultimate, namespace: user.namespace)
project = create_project(user, opts)
......
......@@ -52,7 +52,7 @@ RSpec.shared_examples 'dashboard ultimate trial callout' do
it 'hides promotion callout if user owns a paid namespace', :js do
allow_any_instance_of(EE::DashboardHelper).to receive(:user_default_dashboard?).and_return(true)
group = create(:group_with_plan, name: 'gold group', plan: :gold_plan)
group = create(:group_with_plan, name: 'ultimate group', plan: :ultimate_plan)
group.add_owner(user)
visit page_path
......@@ -107,7 +107,7 @@ RSpec.shared_examples 'billings ultimate trial callout' do
end
context 'on a ultimate plan' do
let(:plan) { gold_plan }
let(:plan) { ultimate_plan }
let!(:subscription) do
create(:gitlab_subscription, namespace: namespace, hosted_plan: plan, seats: 15)
......
......@@ -122,7 +122,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
end
describe 'security dashboard tab' do
let(:group) { create(:group_with_plan, plan: :gold_plan) }
let(:group) { create(:group_with_plan, plan: :ultimate_plan) }
before do
enable_namespace_license_check!
......
......@@ -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(:gold_plan, title: 'Ultimate') }
let(:plan) { create(:ultimate_plan, title: 'Ultimate') }
it 'displays expiry date and Ultimate' do
render 'shared/billings/trial_status', namespace: group
......
......@@ -20,10 +20,10 @@ RSpec.describe ElasticNamespaceRolloutWorker do
end
def expect_percentage_to_result_in_records(percentage, record_count, mode)
subject.perform('gold', percentage, mode)
subject.perform('ultimate', percentage, mode)
namespace_ids = GitlabSubscription
.with_hosted_plan('gold')
.with_hosted_plan('ultimate')
.order(id: :asc)
.pluck(:namespace_id)
......@@ -55,24 +55,24 @@ RSpec.describe ElasticNamespaceRolloutWorker do
it 'distinguishes different plans' do
# Rollout
subject.perform('gold', 50, ROLLOUT)
subject.perform('ultimate', 50, ROLLOUT)
subject.perform('silver', 25, ROLLOUT)
expect(
ElasticsearchIndexedNamespace.pluck(:namespace_id)
).to contain_exactly(
*get_namespace_ids(:gold, 2),
*get_namespace_ids(:ultimate, 2),
*get_namespace_ids(:silver, 1)
)
# Rollback
subject.perform('gold', 25, ROLLBACK)
subject.perform('ultimate', 25, ROLLBACK)
subject.perform('silver', 0, ROLLBACK)
expect(
ElasticsearchIndexedNamespace.pluck(:namespace_id)
).to contain_exactly(
*get_namespace_ids(:gold, 1)
*get_namespace_ids(:ultimate, 1)
)
end
......@@ -85,11 +85,11 @@ RSpec.describe ElasticNamespaceRolloutWorker do
changes: 3,
expected_count: 3,
current_count: 0,
plan: 'gold'
plan: 'ultimate'
)
).and_call_original
subject.perform('gold', 75, ROLLOUT)
subject.perform('ultimate', 75, ROLLOUT)
expect(logger).to receive(:info).with(
hash_including(
......@@ -97,10 +97,10 @@ RSpec.describe ElasticNamespaceRolloutWorker do
changes: 2,
expected_count: 1,
current_count: 3,
plan: 'gold'
plan: 'ultimate'
)
).and_call_original
subject.perform('gold', 25, ROLLBACK)
subject.perform('ultimate', 25, ROLLBACK)
end
end
......@@ -10620,7 +10620,7 @@ msgstr ""
msgid "Discover|Security capabilities, integrated into your development lifecycle"
msgstr ""
msgid "Discover|See the other features of the %{linkStart}gold plan%{linkEnd}"
msgid "Discover|See the other features of the %{linkStart}ultimate plan%{linkEnd}"
msgstr ""
msgid "Discover|Start a free trial"
......@@ -15632,7 +15632,7 @@ msgstr ""
msgid "InProductMarketing|Start a GitLab Gold trial today in less than one minute, no credit card required."
msgstr ""
msgid "InProductMarketing|Start a free trial of GitLab Gold – no CC required"
msgid "InProductMarketing|Start a free trial of GitLab Ultimate – no CC required"
msgstr ""
msgid "InProductMarketing|Start a trial"
......@@ -21089,7 +21089,7 @@ msgstr ""
msgid "Only project members will be imported. Group members will be skipped."
msgstr ""
msgid "Only projects created under a Gold license are available in Security Dashboards."
msgid "Only projects created under a Ultimate license are available in Security Dashboards."
msgstr ""
msgid "Only verified users with an email address in any of these domains can be added to the group."
......
......@@ -48,18 +48,18 @@ RSpec.describe 'admin/application_settings/_package_registry' do
end
context 'with multiple plans' do
let_it_be(:plan) { create(:plan, name: 'Gold') }
let_it_be(:gold_plan_limits) { create(:plan_limits, :with_package_file_sizes, plan: plan) }
let_it_be(:plan) { create(:plan, name: 'Ultimate') }
let_it_be(:ultimate_plan_limits) { create(:plan_limits, :with_package_file_sizes, plan: plan) }
before do
assign(:plans, [default_plan_limits.plan, gold_plan_limits.plan])
assign(:plans, [default_plan_limits.plan, ultimate_plan_limits.plan])
end
it 'displays the plan name when there is more than one plan' do
subject
expect(page).to have_content('Default')
expect(page).to have_content('Gold')
expect(page).to have_content('Ultimate')
end
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