Commit efe67a3b authored by Thong Kuah's avatar Thong Kuah

Merge branch '349713-discussion-avoid-gitlab-dev_env_or_com4' into 'master'

Remove ee uses of dev_env_or_com

See merge request gitlab-org/gitlab!82151
parents 76141b84 202d0774
......@@ -12,7 +12,7 @@ module EE
end
def check_if_gl_com_or_dev
render_404 unless ::Gitlab.dev_env_or_com?
render_404 unless ::Gitlab.com?
end
def verify_namespace_plan_check_enabled
......
......@@ -52,7 +52,7 @@ module EE
def update_params
clean_params = super.merge(params.require(:user).permit(:email_opted_in, :registration_objective))
return clean_params unless ::Gitlab.dev_env_or_com?
return clean_params unless ::Gitlab.com?
clean_params[:email_opted_in] = '1' if clean_params[:setup_for_company] == 'true'
......
......@@ -19,7 +19,7 @@ class SurveyResponsesController < ApplicationController
private
def track_response
return unless Gitlab.dev_env_or_com?
return unless Gitlab.com?
data = {
survey_id: to_number(params[:survey_id]),
......@@ -42,7 +42,7 @@ class SurveyResponsesController < ApplicationController
end
def set_invite_link
return unless Gitlab.dev_env_or_com?
return unless Gitlab.com?
return unless Gitlab::Utils.to_boolean(params[:show_invite_link])
return unless Feature.enabled?(:calendly_invite_link)
......
......@@ -4,7 +4,7 @@ module EE
module Ci
module PipelinesHelper
def show_cc_validation_alert?(pipeline)
return false unless ::Gitlab.dev_env_or_com?
return false unless ::Gitlab.com?
return false if pipeline.user.blank? || current_user != pipeline.user
pipeline.user_not_verified? && !pipeline.user.has_required_credit_card_to_run_pipelines?(pipeline.project)
......
......@@ -17,20 +17,20 @@ module EE
end
def show_buy_pipeline_minutes?(project, namespace)
return false unless ::Gitlab.dev_env_or_com?
return false unless ::Gitlab.com?
show_out_of_pipeline_minutes_notification?(project, namespace)
end
def show_pipeline_minutes_notification_dot?(project, namespace)
return false unless ::Gitlab.dev_env_or_com?
return false unless ::Gitlab.com?
return false if notification_dot_acknowledged?
show_out_of_pipeline_minutes_notification?(project, namespace)
end
def show_buy_pipeline_with_subtext?(project, namespace)
return false unless ::Gitlab.dev_env_or_com?
return false unless ::Gitlab.com?
return false unless notification_dot_acknowledged?
show_out_of_pipeline_minutes_notification?(project, namespace)
......
......@@ -3,7 +3,7 @@
module EE
module TrialRegistrationHelper
def social_signin_enabled?
::Gitlab.dev_env_or_com? &&
::Gitlab.com? &&
omniauth_enabled? &&
devise_mapping.omniauthable? &&
button_based_providers_enabled?
......
......@@ -104,7 +104,7 @@ module EE
end
def show_verification_reminder?
return false unless ::Gitlab.dev_env_or_com?
return false unless ::Gitlab.com?
return false unless ::Feature.enabled?(:verification_reminder, default_enabled: :yaml)
return false unless current_user
return false if current_user.has_valid_credit_card?
......
......@@ -69,7 +69,7 @@ module EE
end
def signup_onboarding_enabled?
::Gitlab.dev_env_or_com?
::Gitlab.com?
end
end
end
......@@ -26,7 +26,7 @@ module SeatsCountAlertHelper
end
def show_seats_count_alert?
return false unless ::Gitlab.dev_env_or_com? && group_with_owner? && current_subscription
return false unless ::Gitlab.com? && group_with_owner? && current_subscription
return false if user_dismissed_alert?
!!@display_seats_count_alert
......
......@@ -455,7 +455,7 @@ module EE
end
def requires_credit_card?(project)
return false unless ::Gitlab.dev_env_or_com?
return false unless ::Gitlab.com?
return false unless created_after_credit_card_release_day?(project)
root_namespace = project.root_namespace
......
......@@ -160,7 +160,7 @@ class GitlabSubscription < ApplicationRecord
end
def automatically_index_in_elasticsearch?
return false unless ::Gitlab.dev_env_or_com?
return false unless ::Gitlab.com?
return false if expired?
# We only index paid groups on dot com for now.
......
......@@ -194,7 +194,7 @@ module EE
def send_account_validation_email(pipeline)
return unless ::Feature.enabled?(:account_validation_email)
return unless ::Gitlab.dev_env_or_com?
return unless ::Gitlab.com?
return unless pipeline.failed?
return unless pipeline.user_not_verified?
......
- return unless Gitlab.dev_env_or_com?
- return unless Gitlab.com?
- expanded = integration_expanded?('slack_app_')
%section.settings.as-slack.no-animate#js-slack-settings{ class: ('expanded' if expanded) }
......
......@@ -7,7 +7,7 @@
.pipeline-quota.container-fluid
.row
.col-sm-6.offset-sm-6
- if ::Gitlab.dev_env_or_com?
- if ::Gitlab.com?
= link_to s_('UsageQuota|Buy additional minutes'),
buy_additional_minutes_path(namespace),
target: buy_addon_target_attr(namespace),
......
- return unless Gitlab.dev_env_or_com?
- return unless Gitlab.com?
- return if in_trial_flow?
- experiment(:bypass_registration, user: current_user) do |e|
......
- return unless Gitlab.dev_env_or_com?
- return unless Gitlab.com?
- if user_has_memberships?
= f.hidden_field :setup_for_company, value: true
......
......@@ -12,7 +12,7 @@ class ElasticRemoveExpiredNamespaceSubscriptionsFromIndexCronWorker
idempotent!
def perform
return unless ::Gitlab.dev_env_or_com?
return unless ::Gitlab.com?
in_lock(self.class.name.underscore, ttl: 1.hour, retries: 0) do
GitlabSubscription.yield_long_expired_indexed_namespaces do |indexed_namespace|
......
......@@ -11,7 +11,7 @@ module EE
gon.roadmap_epics_limit = 1000
if ::Gitlab.dev_env_or_com?
if ::Gitlab.com?
gon.subscriptions_url = ::Gitlab::SubscriptionPortal::SUBSCRIPTIONS_URL
gon.payment_form_url = ::Gitlab::SubscriptionPortal::PAYMENT_FORM_URL
gon.registration_validation_form_url = ::Gitlab::SubscriptionPortal::REGISTRATION_VALIDATION_FORM_URL
......
......@@ -14,7 +14,7 @@ module Gitlab
def self.gitlab_com_group_member?(user_id)
return false unless user_id
Gitlab.dev_env_or_com? && gitlab_com_user_ids.include?(user_id)
Gitlab.com? && gitlab_com_user_ids.include?(user_id)
end
# rubocop: disable CodeReuse/ActiveRecord
......
......@@ -13,7 +13,7 @@ RSpec.describe Registrations::GroupsController do
let_it_be(:trial_form_params) { { trial: 'false' } }
let_it_be(:trial_onboarding_flow_params) { {} }
let(:dev_env_or_com) { true }
let(:com) { true }
let(:group_params) { { name: 'Group name', path: 'group-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE.to_s, create_event: true, setup_for_company: setup_for_company } }
let(:setup_for_company) { nil }
let(:params) do
......@@ -30,7 +30,7 @@ RSpec.describe Registrations::GroupsController do
context 'with an authenticated user' do
before do
sign_in(user)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
context 'when on .com' do
......@@ -235,7 +235,7 @@ RSpec.describe Registrations::GroupsController do
end
context 'when not on .com' do
let(:dev_env_or_com) { false }
let(:com) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......
......@@ -15,7 +15,7 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do
subject { get :new }
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(::Gitlab).to receive(:com?).and_return(true)
sign_in(user)
end
......@@ -64,7 +64,7 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do
let(:extra_params) { {} }
let(:group_params) { { name: 'Group name', path: 'group-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE.to_s, setup_for_company: setup_for_company } }
let(:project_params) { { name: 'New project', path: 'project-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE, initialize_with_readme: 'true' } }
let(:dev_env_or_com) { true }
let(:com) { true }
let(:setup_for_company) { nil }
let(:combined_registration?) { true }
......@@ -76,7 +76,7 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do
context 'with an authenticated user' do
before do
sign_in(user)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
it_behaves_like 'hides email confirmation warning'
......@@ -155,7 +155,7 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do
end
context 'with signup onboarding not enabled' do
let(:dev_env_or_com) { false }
let(:com) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......@@ -339,7 +339,7 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do
let(:params) { { group: group_params, import_url: new_import_github_path } }
let(:group_params) { { name: 'Group name', path: 'group-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE.to_s, setup_for_company: nil } }
let(:dev_env_or_com) { true }
let(:com) { true }
context 'with an unauthenticated user' do
it { is_expected.to have_gitlab_http_status(:redirect) }
......@@ -349,7 +349,7 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do
context 'with an authenticated user' do
before do
sign_in(user)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
it_behaves_like 'hides email confirmation warning'
......@@ -421,7 +421,7 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do
context 'with an authenticated user' do
before do
sign_in(user)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(::Gitlab).to receive(:com?).and_return(true)
end
it { is_expected.to have_gitlab_http_status(:redirect) }
......
......@@ -16,11 +16,11 @@ RSpec.describe Registrations::ProjectsController do
end
context 'with an authenticated user' do
let(:dev_env_or_com) { true }
let(:com) { true }
before do
sign_in(user)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
context 'when on .com' do
......@@ -43,7 +43,7 @@ RSpec.describe Registrations::ProjectsController do
end
context 'when not on .com' do
let(:dev_env_or_com) { false }
let(:com) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......
......@@ -14,11 +14,11 @@ RSpec.describe Registrations::VerificationController do
end
context 'with an authenticated user' do
let(:dev_env_or_com) { true }
let(:com) { true }
before do
sign_in(user)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
context 'when on .com' do
......@@ -36,7 +36,7 @@ RSpec.describe Registrations::VerificationController do
end
context 'when not on .com' do
let(:dev_env_or_com) { false }
let(:com) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......
......@@ -3,17 +3,17 @@
require 'spec_helper'
RSpec.describe TrialRegistrationsController do
let(:dev_env_or_com) { true }
let(:com) { true }
before do
allow(Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(Gitlab).to receive(:com?).and_return(com)
end
shared_examples 'a dot-com only feature' do
let(:success_status) { :ok }
context 'when not on gitlab.com and not in development environment' do
let(:dev_env_or_com) { false }
let(:com) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......
......@@ -5,11 +5,9 @@ require 'spec_helper'
RSpec.describe TrialsController, :saas do
let_it_be(:user) { create(:user, email_opted_in: true, last_name: 'Doe') }
let(:dev_env_or_com) { true }
let(:logged_in) { true }
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
sign_in(user) if logged_in
end
......@@ -30,13 +28,15 @@ RSpec.describe TrialsController, :saas do
shared_examples 'a dot-com only feature' do
let(:success_status) { :ok }
context 'when not on gitlab.com and not in development environment' do
let(:dev_env_or_com) { false }
context 'when not on gitlab.com ' do
before do
allow(::Gitlab).to receive(:com?).and_return(false)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end
context 'when on gitlab.com or in dev environment' do
context 'when on gitlab.com' do
it { is_expected.to have_gitlab_http_status(success_status) }
end
end
......
......@@ -10,7 +10,7 @@ RSpec.describe 'GitLab.com Google Analytics DataLayer', :js do
let_it_be(:group) { create(:group) }
before do
allow(Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(Gitlab).to receive(:com?).and_return(true)
stub_application_setting(require_admin_approval_after_user_signup: false)
stub_feature_flags(gitlab_gtm_datalayer: true)
stub_config(extra: { google_tag_manager_id: google_tag_manager_id, google_tag_manager_nonce_id: google_tag_manager_id })
......
......@@ -7,11 +7,11 @@ RSpec.describe 'Group or Project invitations' do
let(:project) { create(:project, :repository, namespace: group) }
let(:group_invite) { create(:group_member, :invited, group: group) }
let(:new_user) { build_stubbed(:user, email: group_invite.invite_email) }
let(:dev_env_or_com) { true }
let(:com) { true }
before do
stub_application_setting(require_admin_approval_after_user_signup: false)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
visit invite_path(group_invite.raw_invite_token)
end
......@@ -47,7 +47,7 @@ RSpec.describe 'Group or Project invitations' do
end
context 'when not on .com' do
let(:dev_env_or_com) { false }
let(:com) { false }
it 'bypasses the setup_for_company question' do
fill_in_sign_up_form(new_user)
......
......@@ -11,7 +11,7 @@ RSpec.describe 'OneTrust in the sign up flow' do
before do
stub_config(extra: { one_trust_id: one_trust_id })
stub_feature_flags(ecomm_instrumentation: true)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(::Gitlab).to receive(:com?).and_return(true)
sign_in(user)
end
......
......@@ -45,7 +45,7 @@ RSpec.describe EE::Ci::PipelinesHelper do
let(:pipeline) { instance_double(Ci::Pipeline) }
before do
allow(Gitlab).to receive(:dev_env_or_com?) { false }
allow(Gitlab).to receive(:com?) { false }
end
it { is_expected.to be_falsy }
......
......@@ -22,7 +22,7 @@ RSpec.describe EE::Ci::RunnersHelper do
context 'with a project and namespace' do
context 'when not on dot com' do
let(:dev_env_or_com) { false }
let(:com) { false }
it { is_expected.to be_falsey }
end
......@@ -106,7 +106,7 @@ RSpec.describe EE::Ci::RunnersHelper do
end
context 'with notifications' do
let(:dev_env_or_com) { true }
let(:com) { true }
describe '.show_buy_pipeline_minutes?' do
subject { helper.show_buy_pipeline_minutes?(project, namespace) }
......@@ -114,7 +114,7 @@ RSpec.describe EE::Ci::RunnersHelper do
context 'when on dot com' do
it_behaves_like 'minutes notification' do
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
end
end
......@@ -124,7 +124,7 @@ RSpec.describe EE::Ci::RunnersHelper do
subject { helper.show_pipeline_minutes_notification_dot?(project, namespace) }
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
it_behaves_like 'minutes notification'
......@@ -151,7 +151,7 @@ RSpec.describe EE::Ci::RunnersHelper do
subject { helper.show_buy_pipeline_with_subtext?(project, namespace) }
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
context 'when the notification dot has not been acknowledged' do
......
......@@ -7,7 +7,7 @@ RSpec.describe EE::TrialRegistrationHelper do
describe '#social_signin_enabled?' do
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(com)
allow(::Gitlab).to receive(:com?).and_return(com)
allow(view).to receive(:omniauth_enabled?).and_return(omniauth_enabled)
allow(view).to receive(:button_based_providers_enabled?).and_return(button_based_providers_enabled)
allow(view).to receive(:devise_mapping).and_return(double(omniauthable?: omniauthable))
......
......@@ -431,7 +431,7 @@ RSpec.describe EE::Users::CalloutsHelper do
with_them do
before do
allow(Gitlab).to receive(:dev_env_or_com?).and_return(on_gitlab_com?)
allow(Gitlab).to receive(:com?).and_return(on_gitlab_com?)
allow(helper).to receive(:current_user).and_return(logged_in? ? user : nil)
allow(user).to receive(:has_valid_credit_card?).and_return(!unverified?)
pipeline.update!(failure_reason: nil) unless failed_pipeline?
......@@ -444,7 +444,7 @@ RSpec.describe EE::Users::CalloutsHelper do
describe 'dismissing the alert timing' do
before do
allow(Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(Gitlab).to receive(:com?).and_return(true)
allow(helper).to receive(:current_user).and_return(user)
create(:callout, user: user, feature_name: :verification_reminder, dismissed_at: Time.current)
create(:ci_pipeline, user: user, failure_reason: :user_not_verified, created_at: pipeline_created_at)
......
......@@ -28,7 +28,7 @@ RSpec.describe EE::Gitlab::GonHelper do
context 'when GitLab.com' do
before do
allow(Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(Gitlab).to receive(:com?).and_return(true)
end
it 'includes CustomersDot variables' do
......
......@@ -1751,7 +1751,7 @@ RSpec.describe User do
with_them do
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(saas == :saas)
allow(::Gitlab).to receive(:com?).and_return(saas == :saas)
user.created_at = ::Users::CreditCardValidation::RELEASE_DAY + days_from_release.days
allow(user).to receive(:credit_card_validated_at).and_return(Time.current) if cc_present
allow(project.namespace).to receive(:free_plan?).and_return(plan == :free)
......@@ -1805,7 +1805,7 @@ RSpec.describe User do
with_them do
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(saas == :saas)
allow(::Gitlab).to receive(:com?).and_return(saas == :saas)
user.created_at = ::Users::CreditCardValidation::RELEASE_DAY + days_from_release.days
allow(user).to receive(:credit_card_validated_at).and_return(Time.current) if cc_present
allow(project.namespace).to receive(:free_plan?).and_return(plan == :free)
......
......@@ -367,12 +367,10 @@ RSpec.describe GitlabSubscription, :saas do
let_it_be(:namespace) { create(:namespace) }
let(:gitlab_subscription) { build(:gitlab_subscription, plan, namespace: namespace) }
let(:dev_env_or_com) { true }
let(:expiration_date) { Date.today + 10 }
let(:plan) { :bronze }
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
gitlab_subscription.end_date = expiration_date
end
......@@ -423,8 +421,10 @@ RSpec.describe GitlabSubscription, :saas do
end
end
context 'when not ::Gitlab.dev_env_or_com?' do
let(:dev_env_or_com) { false }
context 'when not ::Gitlab.com?' do
before do
allow(::Gitlab).to receive(:com?).and_return(false)
end
it 'does not index the namespace' do
expect(ElasticsearchIndexedNamespace).not_to receive(:safe_find_or_create_by!)
......@@ -579,7 +579,7 @@ RSpec.describe GitlabSubscription, :saas do
let_it_be(:expired_subscription2) { create(:gitlab_subscription, :bronze, end_date: Date.today - 40) }
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(::Gitlab).to receive(:com?).and_return(true)
ElasticsearchIndexedNamespace.safe_find_or_create_by!(namespace_id: not_expired_subscription1.namespace_id)
ElasticsearchIndexedNamespace.safe_find_or_create_by!(namespace_id: not_expired_subscription2.namespace_id)
ElasticsearchIndexedNamespace.safe_find_or_create_by!(namespace_id: recently_expired_subscription.namespace_id)
......
......@@ -5,14 +5,14 @@ require 'spec_helper'
RSpec.describe Projects::Pipelines::EmailCampaignsController do
let_it_be(:user) { create(:user) }
let(:dev_env_or_com) { true }
let(:com) { true }
subject(:request) do
get project_pipeline_validate_account_path(project, pipeline)
end
before do
allow(Gitlab).to receive(:dev_env_or_com?) { dev_env_or_com }
allow(Gitlab).to receive(:com?) { com }
end
describe 'GET #validate_account', :snowplow do
......@@ -49,7 +49,7 @@ RSpec.describe Projects::Pipelines::EmailCampaignsController do
end
context 'when not in .com or dev env' do
let(:dev_env_or_com) { false }
let(:com) { false }
it 'returns 404' do
expect(response).to have_gitlab_http_status(:not_found)
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe SurveyResponsesController do
describe 'GET #index' do
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(ondotcom)
allow(::Gitlab).to receive(:com?).and_return(ondotcom)
end
subject(:request) { get survey_responses_path(params) }
......
......@@ -1009,7 +1009,7 @@ RSpec.describe EE::NotificationService, :mailer do
subject(:pipeline_finished) { NotificationService.new.pipeline_finished(pipeline) }
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(::Gitlab).to receive(:com?).and_return(true)
allow(user).to receive(:has_required_credit_card_to_run_pipelines?).and_return(has_required_credit_card_to_run_pipelines)
project.add_maintainer(user)
......@@ -1040,7 +1040,7 @@ RSpec.describe EE::NotificationService, :mailer do
context 'when not in dev env or gitlab.com' do
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(false)
allow(::Gitlab).to receive(:com?).and_return(false)
end
include_examples 'does not send account activation email'
......
......@@ -24,7 +24,7 @@ RSpec.shared_examples "Registrations::GroupsController GET #new" do
using RSpec::Parameterized::TableSyntax
let_it_be(:user) { create(:user) }
let(:dev_env_or_com) { true }
let(:com) { true }
subject { get :new }
......@@ -36,7 +36,7 @@ RSpec.shared_examples "Registrations::GroupsController GET #new" do
context 'with an authenticated user' do
before do
sign_in(user)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
end
context 'when on .com' do
......@@ -64,7 +64,7 @@ RSpec.shared_examples "Registrations::GroupsController GET #new" do
end
context 'when not on .com' do
let(:dev_env_or_com) { false }
let(:com) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......
......@@ -9,7 +9,7 @@ RSpec.shared_examples "Registrations::ProjectsController POST #create" do
let_it_be(:first_project) { create(:project) }
let(:params) { { namespace_id: namespace.id, name: 'New project', path: 'project-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE } }
let(:dev_env_or_com) { true }
let(:com) { true }
let(:extra_params) { {} }
let(:success_path) { nil }
let(:stored_location_for) { nil }
......@@ -23,7 +23,7 @@ RSpec.shared_examples "Registrations::ProjectsController POST #create" do
before do
namespace.add_owner(user)
sign_in(user)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
allow(::Gitlab).to receive(:com?).and_return(com)
allow(controller).to receive(:experiment).and_call_original
end
......@@ -132,7 +132,7 @@ RSpec.shared_examples "Registrations::ProjectsController POST #create" do
end
context 'with signup onboarding not enabled' do
let(:dev_env_or_com) { false }
let(:com) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
......
......@@ -12,7 +12,7 @@ RSpec.describe ElasticRemoveExpiredNamespaceSubscriptionsFromIndexCronWorker, :s
let(:expired_subscription2) { create(:gitlab_subscription, :bronze, end_date: Date.today - 35) }
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(true)
allow(::Gitlab).to receive(:com?).and_return(true)
ElasticsearchIndexedNamespace.safe_find_or_create_by!(namespace_id: not_expired_subscription1.namespace_id)
ElasticsearchIndexedNamespace.safe_find_or_create_by!(namespace_id: not_expired_subscription2.namespace_id)
ElasticsearchIndexedNamespace.safe_find_or_create_by!(namespace_id: recently_expired_subscription.namespace_id)
......@@ -35,9 +35,9 @@ RSpec.describe ElasticRemoveExpiredNamespaceSubscriptionsFromIndexCronWorker, :s
end
end
context 'when not dev_env_or_com?' do
context 'when not com?' do
before do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(false)
allow(::Gitlab).to receive(:com?).and_return(false)
end
it 'does nothing' do
......
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