Commit a3908e36 authored by Mark Chao's avatar Mark Chao

Err if gitlab_subscription in created outside SaaS

Ensure specs are under saas context when needed

* mention of .com
* gitlab_subscription
* group_with_plan or namespace_with_plan factories

Part of preparation for
https://gitlab.com/gitlab-org/gitlab/-/issues/214434
parent 2b321a39
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Billings > Extend / Reactivate Trial', :js do RSpec.describe 'Billings > Extend / Reactivate Trial', :js, :saas do
include SubscriptionPortalHelpers include SubscriptionPortalHelpers
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -21,7 +21,7 @@ RSpec.describe 'Dashboard operations', :js do ...@@ -21,7 +21,7 @@ RSpec.describe 'Dashboard operations', :js do
expect(page).to have_text(pipeline.status) expect(page).to have_text(pipeline.status)
end end
context 'when opened on gitlab.com', :sass do context 'when opened on gitlab.com', :saas do
before do before do
stub_application_setting(check_namespace_plan: true) stub_application_setting(check_namespace_plan: true)
stub_licensed_features(operations_dashboard: true) stub_licensed_features(operations_dashboard: true)
......
...@@ -249,7 +249,7 @@ RSpec.describe 'Edit group settings' do ...@@ -249,7 +249,7 @@ RSpec.describe 'Edit group settings' do
end end
end end
context 'namespace plan is checked' do context 'namespace plan is checked', :saas do
before do before do
create(:gitlab_subscription, namespace: group, hosted_plan: plan) create(:gitlab_subscription, namespace: group, hosted_plan: plan)
stub_licensed_features(group_project_templates: true) stub_licensed_features(group_project_templates: true)
......
...@@ -45,7 +45,7 @@ RSpec.describe 'Projects > Push Rules', :js do ...@@ -45,7 +45,7 @@ RSpec.describe 'Projects > Push Rules', :js do
expect(page).to have_content(title) expect(page).to have_content(title)
end end
describe 'with GL.com plans' do describe 'with GL.com plans', :saas do
before do before do
stub_application_setting(check_namespace_plan: true) stub_application_setting(check_namespace_plan: true)
end end
......
...@@ -10,7 +10,7 @@ RSpec.describe ProjectsFinder do ...@@ -10,7 +10,7 @@ RSpec.describe ProjectsFinder do
subject { finder.execute } subject { finder.execute }
describe 'filter by plans' do describe 'filter by plans', :saas do
let(:params) { { plans: plans } } let(:params) { { plans: plans } }
let(:project_ids_relation) { nil } let(:project_ids_relation) { nil }
......
...@@ -289,7 +289,7 @@ RSpec.describe EpicsFinder do ...@@ -289,7 +289,7 @@ RSpec.describe EpicsFinder do
expect { epics.to_a }.not_to exceed_all_query_limit(5) expect { epics.to_a }.not_to exceed_all_query_limit(5)
end end
it 'does not execute more than 6 SQL queries when checking namespace plans' do it 'does not execute more than 6 SQL queries when checking namespace plans', :saas do
allow(Gitlab::CurrentSettings) allow(Gitlab::CurrentSettings)
.to receive(:should_check_namespace_plan?) .to receive(:should_check_namespace_plan?)
.and_return(true) .and_return(true)
......
...@@ -35,7 +35,7 @@ RSpec.describe GroupsHelper do ...@@ -35,7 +35,7 @@ RSpec.describe GroupsHelper do
end end
end end
context 'on .com' do context 'on .com', :saas do
before do before do
allow(::Gitlab).to receive(:com?).and_return(true) allow(::Gitlab).to receive(:com?).and_return(true)
stub_ee_application_setting(should_check_namespace_plan: true) stub_ee_application_setting(should_check_namespace_plan: true)
......
...@@ -132,7 +132,7 @@ RSpec.describe EE::UserCalloutsHelper do ...@@ -132,7 +132,7 @@ RSpec.describe EE::UserCalloutsHelper do
end end
end end
describe '#render_dashboard_ultimate_trial' do describe '#render_dashboard_ultimate_trial', :saas do
let_it_be(:namespace) { create(:namespace) } let_it_be(:namespace) { create(:namespace) }
let_it_be(:ultimate_plan) { create(:ultimate_plan) } let_it_be(:ultimate_plan) { create(:ultimate_plan) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe TrialStatusWidgetHelper do RSpec.describe TrialStatusWidgetHelper, :saas do
describe 'data attributes for mounting Vue components' do describe 'data attributes for mounting Vue components' do
let(:trial_length) { 30 } # days let(:trial_length) { 30 } # days
let(:today_for_specs) { Date.parse('2021-01-15') } let(:today_for_specs) { Date.parse('2021-01-15') }
......
...@@ -9,7 +9,7 @@ RSpec.describe Gitlab::HookData::GroupMemberBuilder do ...@@ -9,7 +9,7 @@ RSpec.describe Gitlab::HookData::GroupMemberBuilder do
let(:data) { described_class.new(group_member).build(event) } let(:data) { described_class.new(group_member).build(event) }
context 'data' do context 'data' do
context 'group_plan attribute' do context 'group_plan attribute', :saas do
let(:group) { create(:group_with_plan, plan: :ultimate_plan) } let(:group) { create(:group_with_plan, plan: :ultimate_plan) }
it 'returns correct group_plan' do it 'returns correct group_plan' do
......
...@@ -17,7 +17,7 @@ RSpec.describe Gitlab::Tracking::StandardContext do ...@@ -17,7 +17,7 @@ RSpec.describe Gitlab::Tracking::StandardContext do
end end
end end
context 'when namespace is available' do context 'when namespace is available', :saas do
subject { described_class.new(namespace: create(:namespace_with_plan, plan: plan)) } subject { described_class.new(namespace: create(:namespace_with_plan, plan: plan)) }
it 'contains plan name' do it 'contains plan name' do
......
...@@ -58,7 +58,7 @@ RSpec.describe Namespace do ...@@ -58,7 +58,7 @@ RSpec.describe Namespace do
end end
described_class::PLANS.each do |namespace_plan| described_class::PLANS.each do |namespace_plan|
describe "#{namespace_plan}_plan?" do describe "#{namespace_plan}_plan?", :saas do
it_behaves_like 'plan helper', namespace_plan it_behaves_like 'plan helper', namespace_plan
end end
end end
...@@ -165,7 +165,7 @@ RSpec.describe Namespace do ...@@ -165,7 +165,7 @@ RSpec.describe Namespace do
end end
context 'scopes' do context 'scopes' do
describe '.with_feature_available_in_plan' do describe '.with_feature_available_in_plan', :saas do
let!(:namespace) { create(:namespace) } let!(:namespace) { create(:namespace) }
context 'plan is nil' do context 'plan is nil' do
...@@ -184,7 +184,7 @@ RSpec.describe Namespace do ...@@ -184,7 +184,7 @@ RSpec.describe Namespace do
end end
end end
describe '.join_gitlab_subscription' do describe '.join_gitlab_subscription', :saas do
let!(:namespace) { create(:namespace) } let!(:namespace) { create(:namespace) }
subject { described_class.join_gitlab_subscription.select('gitlab_subscriptions.hosted_plan_id').first.hosted_plan_id } subject { described_class.join_gitlab_subscription.select('gitlab_subscriptions.hosted_plan_id').first.hosted_plan_id }
...@@ -204,7 +204,7 @@ RSpec.describe Namespace do ...@@ -204,7 +204,7 @@ RSpec.describe Namespace do
end end
end end
describe '.in_active_trial' do describe '.in_active_trial', :saas do
let_it_be(:namespaces) do let_it_be(:namespaces) do
[ [
create(:namespace), create(:namespace),
...@@ -222,7 +222,7 @@ RSpec.describe Namespace do ...@@ -222,7 +222,7 @@ RSpec.describe Namespace do
end end
end end
describe '.not_in_active_trial' do describe '.not_in_active_trial', :saas do
let_it_be(:namespaces) do let_it_be(:namespaces) do
[ [
create(:namespace), create(:namespace),
...@@ -240,7 +240,7 @@ RSpec.describe Namespace do ...@@ -240,7 +240,7 @@ RSpec.describe Namespace do
end end
end end
describe '.in_default_plan' do describe '.in_default_plan', :saas do
subject { described_class.in_default_plan.ids } subject { described_class.in_default_plan.ids }
where(:plan_name, :expect_in_default_plan) do where(:plan_name, :expect_in_default_plan) do
...@@ -268,7 +268,7 @@ RSpec.describe Namespace do ...@@ -268,7 +268,7 @@ RSpec.describe Namespace do
end end
end end
describe '.eligible_for_trial' do describe '.eligible_for_trial', :saas do
let_it_be(:namespace) { create :namespace } let_it_be(:namespace) { create :namespace }
subject { described_class.eligible_for_trial.first } subject { described_class.eligible_for_trial.first }
...@@ -509,13 +509,13 @@ RSpec.describe Namespace do ...@@ -509,13 +509,13 @@ RSpec.describe Namespace do
end end
end end
describe '#feature_available?' do describe '#feature_available?', :saas do
subject { group.licensed_feature_available?(feature) } subject { group.licensed_feature_available?(feature) }
it_behaves_like 'feature available' it_behaves_like 'feature available'
end end
describe '#feature_available_non_trial?' do describe '#feature_available_non_trial?', :saas do
subject { group.feature_available_non_trial?(feature) } subject { group.feature_available_non_trial?(feature) }
it_behaves_like 'feature available' it_behaves_like 'feature available'
...@@ -582,7 +582,7 @@ RSpec.describe Namespace do ...@@ -582,7 +582,7 @@ RSpec.describe Namespace do
it { is_expected.to eq(default_limits) } it { is_expected.to eq(default_limits) }
end end
context 'when "free" plan is defined in the system' do context 'when "free" plan is defined in the system', :saas do
let!(:free_plan) { create(:free_plan) } let!(:free_plan) { create(:free_plan) }
context 'when no limits are set' do context 'when no limits are set' do
...@@ -814,7 +814,7 @@ RSpec.describe Namespace do ...@@ -814,7 +814,7 @@ RSpec.describe Namespace do
end end
end end
describe '#paid?' do describe '#paid?', :saas do
it 'returns true for a root namespace with a paid plan' do it 'returns true for a root namespace with a paid plan' do
create(:gitlab_subscription, :ultimate, namespace: namespace) create(:gitlab_subscription, :ultimate, namespace: namespace)
...@@ -893,7 +893,7 @@ RSpec.describe Namespace do ...@@ -893,7 +893,7 @@ RSpec.describe Namespace do
end end
end end
describe '#billed_user_ids' do describe '#billed_user_ids', :saas do
context 'with a user namespace' do context 'with a user namespace' do
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -1170,7 +1170,7 @@ RSpec.describe Namespace do ...@@ -1170,7 +1170,7 @@ RSpec.describe Namespace do
end end
end end
describe '#billable_members_count' do describe '#billable_members_count', :saas do
context 'with a user namespace' do context 'with a user namespace' do
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -1782,7 +1782,7 @@ RSpec.describe Namespace do ...@@ -1782,7 +1782,7 @@ RSpec.describe Namespace do
end end
end end
describe '#closest_gitlab_subscription' do describe '#closest_gitlab_subscription', :saas do
subject { group.closest_gitlab_subscription } subject { group.closest_gitlab_subscription }
context 'when there is a root ancestor' do context 'when there is a root ancestor' do
......
...@@ -520,7 +520,7 @@ RSpec.describe User do ...@@ -520,7 +520,7 @@ RSpec.describe User do
end end
end end
context 'when namespace plan is checked' do context 'when namespace plan is checked', :saas do
before do before do
create(:gitlab_subscription, namespace: group_1, hosted_plan: create(:bronze_plan)) create(:gitlab_subscription, namespace: group_1, hosted_plan: create(:bronze_plan))
create(:gitlab_subscription, namespace: group_2, hosted_plan: create(:ultimate_plan)) create(:gitlab_subscription, namespace: group_2, hosted_plan: create(:ultimate_plan))
...@@ -1252,7 +1252,7 @@ RSpec.describe User do ...@@ -1252,7 +1252,7 @@ RSpec.describe User do
end end
end end
describe '#manageable_groups_eligible_for_trial' do describe '#manageable_groups_eligible_for_trial', :saas do
let_it_be(:user) { create :user } let_it_be(:user) { create :user }
let_it_be(:non_trialed_group_z) { create :group_with_plan, name: 'Zeta', plan: :free_plan } let_it_be(:non_trialed_group_z) { create :group_with_plan, name: 'Zeta', plan: :free_plan }
let_it_be(:non_trialed_group_a) { create :group_with_plan, name: 'Alpha', plan: :free_plan } let_it_be(:non_trialed_group_a) { create :group_with_plan, name: 'Alpha', plan: :free_plan }
...@@ -1355,7 +1355,7 @@ RSpec.describe User do ...@@ -1355,7 +1355,7 @@ RSpec.describe User do
end end
end end
context 'feature available for specific groups only' do context 'feature available for specific groups only', :saas do
before do before do
allow(Gitlab::CurrentSettings) allow(Gitlab::CurrentSettings)
.to receive(:should_check_namespace_plan?) .to receive(:should_check_namespace_plan?)
...@@ -1392,7 +1392,7 @@ RSpec.describe User do ...@@ -1392,7 +1392,7 @@ RSpec.describe User do
end end
end end
context 'paid namespaces' do context 'paid namespaces', :saas do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let_it_be(:ultimate_group) { create(:group_with_plan, plan: :ultimate_plan) } let_it_be(:ultimate_group) { create(:group_with_plan, plan: :ultimate_plan) }
...@@ -1436,7 +1436,7 @@ RSpec.describe User do ...@@ -1436,7 +1436,7 @@ RSpec.describe User do
end end
end end
describe '#owns_paid_namespace?' do describe '#owns_paid_namespace?', :saas do
context 'when the user is an owner of at least one paid group' do context 'when the user is an owner of at least one paid group' do
it 'returns true' do it 'returns true' do
ultimate_group.add_owner(user) ultimate_group.add_owner(user)
...@@ -1663,7 +1663,7 @@ RSpec.describe User do ...@@ -1663,7 +1663,7 @@ RSpec.describe User do
end end
end end
describe '#owns_upgradeable_namespace?' do describe '#owns_upgradeable_namespace?', :saas do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
subject { user.owns_upgradeable_namespace? } subject { user.owns_upgradeable_namespace? }
...@@ -1891,7 +1891,7 @@ RSpec.describe User do ...@@ -1891,7 +1891,7 @@ RSpec.describe User do
is_expected.to be(false) is_expected.to be(false)
end end
it 'returns false if owns a group with a plan on a trial with an end date' do it 'returns false if owns a group with a plan on a trial with an end date', :saas do
group_with_plan = create(:group_with_plan, name: 'trial group', plan: :premium_plan, trial_ends_on: 1.year.from_now) group_with_plan = create(:group_with_plan, name: 'trial group', plan: :premium_plan, trial_ends_on: 1.year.from_now)
group_with_plan.add_owner(user) group_with_plan.add_owner(user)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe ElasticsearchIndexedNamespace do RSpec.describe ElasticsearchIndexedNamespace, :saas do
before do before do
stub_ee_application_setting(elasticsearch_indexing: true) stub_ee_application_setting(elasticsearch_indexing: true)
end end
...@@ -47,6 +47,8 @@ RSpec.describe ElasticsearchIndexedNamespace do ...@@ -47,6 +47,8 @@ RSpec.describe ElasticsearchIndexedNamespace do
before do before do
stub_ee_application_setting(elasticsearch_indexing: false) stub_ee_application_setting(elasticsearch_indexing: false)
described_class.delete_all # reset index status
end end
def get_indexed_namespaces def get_indexed_namespaces
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe GitlabSubscription do RSpec.describe GitlabSubscription, :saas do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
%i[free_plan bronze_plan premium_plan ultimate_plan].each do |plan| %i[free_plan bronze_plan premium_plan ultimate_plan].each do |plan|
......
...@@ -23,11 +23,7 @@ RSpec.describe Member, type: :model do ...@@ -23,11 +23,7 @@ RSpec.describe Member, type: :model do
end end
describe '#is_using_seat', :aggregate_failures do describe '#is_using_seat', :aggregate_failures do
context 'when hosted on GL.com' do context 'when hosted on GL.com', :saas do
before do
allow(Gitlab).to receive(:com?).and_return true
end
it 'calls users check for using the gitlab_com seat method' do it 'calls users check for using the gitlab_com seat method' do
expect(user).to receive(:using_gitlab_com_seat?).with(group).once.and_return true expect(user).to receive(:using_gitlab_com_seat?).with(group).once.and_return true
expect(user).not_to receive(:using_license_seat?) expect(user).not_to receive(:using_license_seat?)
...@@ -162,7 +158,7 @@ RSpec.describe Member, type: :model do ...@@ -162,7 +158,7 @@ RSpec.describe Member, type: :model do
end end
end end
context 'check if user cap has been reached' do context 'check if user cap has been reached', :saas do
let_it_be(:group, refind: true) do let_it_be(:group, refind: true) do
create(:group_with_plan, plan: :ultimate_plan, create(:group_with_plan, plan: :ultimate_plan,
namespace_settings: create(:namespace_settings, new_user_signups_cap: 1)) namespace_settings: create(:namespace_settings, new_user_signups_cap: 1))
......
...@@ -1411,36 +1411,38 @@ RSpec.describe GroupPolicy do ...@@ -1411,36 +1411,38 @@ RSpec.describe GroupPolicy do
end end
end end
it_behaves_like 'model with wiki policies', :saas do context 'under .com', :saas do
let_it_be_with_refind(:container) { create(:group_with_plan, plan: :premium_plan) } it_behaves_like 'model with wiki policies' do
let_it_be(:user) { owner } let_it_be_with_refind(:container) { create(:group_with_plan, plan: :premium_plan) }
let_it_be(:user) { owner }
before_all do before_all do
create(:license, plan: License::PREMIUM_PLAN) create(:license, plan: License::PREMIUM_PLAN)
end end
before do
enable_namespace_license_check!
end
# We don't have feature toggles on groups yet, so we currently simulate before do
# this by stubbing the license check instead. enable_namespace_license_check!
def set_access_level(access_level) end
case access_level
when ProjectFeature::ENABLED # We don't have feature toggles on groups yet, so we currently simulate
stub_licensed_features(group_wikis: true) # this by stubbing the license check instead.
when ProjectFeature::DISABLED def set_access_level(access_level)
stub_licensed_features(group_wikis: false) case access_level
when ProjectFeature::PRIVATE when ProjectFeature::ENABLED
skip('Access level private is not supported yet for group wikis, see https://gitlab.com/gitlab-org/gitlab/-/issues/208412') stub_licensed_features(group_wikis: true)
when ProjectFeature::DISABLED
stub_licensed_features(group_wikis: false)
when ProjectFeature::PRIVATE
skip('Access level private is not supported yet for group wikis, see https://gitlab.com/gitlab-org/gitlab/-/issues/208412')
end
end end
end
context 'when the feature is not licensed on this group' do context 'when the feature is not licensed on this group' do
let_it_be(:container) { create(:group_with_plan, plan: :bronze_plan) } let_it_be(:container) { create(:group_with_plan, plan: :bronze_plan) }
it 'does not include the wiki permissions' do it 'does not include the wiki permissions' do
expect_disallowed(*wiki_permissions[:all]) expect_disallowed(*wiki_permissions[:all])
end
end end
end end
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe SubscriptionPresenter do RSpec.describe SubscriptionPresenter, :saas do
let(:subscription) { create(:gitlab_subscription) } let(:subscription) { create(:gitlab_subscription) }
let(:presenter) { described_class.new(subscription) } let(:presenter) { described_class.new(subscription) }
......
...@@ -121,7 +121,7 @@ RSpec.describe API::Namespaces do ...@@ -121,7 +121,7 @@ RSpec.describe API::Namespaces do
end end
end end
context 'with gitlab subscription' do context 'with gitlab subscription', :saas do
before do before do
group1.add_guest(user) group1.add_guest(user)
...@@ -378,7 +378,7 @@ RSpec.describe API::Namespaces do ...@@ -378,7 +378,7 @@ RSpec.describe API::Namespaces do
end end
end end
context "when passing attributes for gitlab_subscription" do context "when passing attributes for gitlab_subscription", :saas do
let(:gitlab_subscription) do let(:gitlab_subscription) do
{ {
start_date: '2019-06-01', start_date: '2019-06-01',
...@@ -442,7 +442,7 @@ RSpec.describe API::Namespaces do ...@@ -442,7 +442,7 @@ RSpec.describe API::Namespaces do
end end
end end
describe 'POST :id/gitlab_subscription' do describe 'POST :id/gitlab_subscription', :saas do
let(:params) do let(:params) do
{ seats: 10, { seats: 10,
plan_code: 'gold', plan_code: 'gold',
...@@ -522,7 +522,7 @@ RSpec.describe API::Namespaces do ...@@ -522,7 +522,7 @@ RSpec.describe API::Namespaces do
end end
end end
describe 'GET :id/gitlab_subscription' do describe 'GET :id/gitlab_subscription', :saas do
def do_get(current_user) def do_get(current_user)
get api("/namespaces/#{namespace.id}/gitlab_subscription", current_user) get api("/namespaces/#{namespace.id}/gitlab_subscription", current_user)
end end
...@@ -583,7 +583,7 @@ RSpec.describe API::Namespaces do ...@@ -583,7 +583,7 @@ RSpec.describe API::Namespaces do
end end
end end
describe 'PUT :id/gitlab_subscription' do describe 'PUT :id/gitlab_subscription', :saas do
def do_put(namespace_id, current_user, payload) def do_put(namespace_id, current_user, payload)
put api("/namespaces/#{namespace_id}/gitlab_subscription", current_user), params: payload put api("/namespaces/#{namespace_id}/gitlab_subscription", current_user), params: payload
end end
......
...@@ -57,7 +57,7 @@ RSpec.describe Dashboard::Projects::ListService do ...@@ -57,7 +57,7 @@ RSpec.describe Dashboard::Projects::ListService do
it_behaves_like 'project not found' it_behaves_like 'project not found'
end end
describe 'checking license' do describe 'checking license', :saas do
let(:projects) { [project] } let(:projects) { [project] }
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
......
...@@ -29,7 +29,7 @@ RSpec.describe Members::CreateService do ...@@ -29,7 +29,7 @@ RSpec.describe Members::CreateService do
create(:group_member, :invited, group: subgroup) create(:group_member, :invited, group: subgroup)
end end
context 'with group plan' do context 'with group plan', :saas do
let(:plan_limits) { create(:plan_limits, daily_invites: daily_invites) } let(:plan_limits) { create(:plan_limits, daily_invites: daily_invites) }
let(:plan) { create(:plan, limits: plan_limits) } let(:plan) { create(:plan, limits: plan_limits) }
let!(:subscription) do let!(:subscription) do
......
...@@ -13,7 +13,7 @@ RSpec.shared_examples 'pushes wip limits to frontend' do ...@@ -13,7 +13,7 @@ RSpec.shared_examples 'pushes wip limits to frontend' do
end end
end end
context 'on .com' do context 'on .com', :saas do
before do before do
enable_namespace_license_check! enable_namespace_license_check!
end end
......
...@@ -137,7 +137,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do ...@@ -137,7 +137,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
end end
end end
describe 'Security & Compliance menu' do describe 'Security & Compliance menu', :saas do
let(:group) { create(:group_with_plan, plan: :ultimate_plan) } let(:group) { create(:group_with_plan, plan: :ultimate_plan) }
before do before do
...@@ -263,7 +263,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do ...@@ -263,7 +263,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
end end
end end
context 'when security dashboard feature is disabled' do context 'when security dashboard feature is disabled', :saas do
let(:group) { create(:group_with_plan, plan: :bronze_plan) } let(:group) { create(:group_with_plan, plan: :bronze_plan) }
it 'is not visible' do it 'is not visible' do
......
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe ElasticNamespaceRolloutWorker do RSpec.describe ElasticNamespaceRolloutWorker, :saas do
before do before do
stub_const('ROLLOUT', described_class::ROLLOUT) stub_const('ROLLOUT', described_class::ROLLOUT)
stub_const('ROLLBACK', described_class::ROLLBACK) stub_const('ROLLBACK', described_class::ROLLBACK)
ElasticsearchIndexedNamespace.delete_all # reset index
end end
Plan::PAID_HOSTED_PLANS.each do |plan| Plan::PAID_HOSTED_PLANS.each do |plan|
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe ElasticRemoveExpiredNamespaceSubscriptionsFromIndexCronWorker do RSpec.describe ElasticRemoveExpiredNamespaceSubscriptionsFromIndexCronWorker, :saas do
subject { described_class.new } subject { described_class.new }
let(:not_expired_subscription1) { create(:gitlab_subscription, :bronze, end_date: Date.today + 2) } let(:not_expired_subscription1) { create(:gitlab_subscription, :bronze, end_date: Date.today + 2) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker do RSpec.describe UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker, :saas do
describe '#perform' do describe '#perform' do
subject { described_class.new } subject { described_class.new }
......
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