diff --git a/ee/app/controllers/admin/gitlab_duo_controller.rb b/ee/app/controllers/admin/gitlab_duo_controller.rb index 4563bbe252af4907374dbefc4b8e877b821e74f1..f4652e8b82dd6add33952d4f778a7fb6dac1c533 100644 --- a/ee/app/controllers/admin/gitlab_duo_controller.rb +++ b/ee/app/controllers/admin/gitlab_duo_controller.rb @@ -21,7 +21,7 @@ def show; end private def ensure_feature_available! - render_404 if Gitlab.com? # rubocop:disable Gitlab/AvoidGitlabInstanceChecks -- Not related to SaaS offerings + render_404 if gitlab_com_subscription? render_404 unless License.current&.paid? end end diff --git a/ee/spec/requests/admin/gitlab_duo_controller_spec.rb b/ee/spec/requests/admin/gitlab_duo_controller_spec.rb index 9b51cdce57cd5e25fe4fccb44f2a9b9a4467492d..9c99ff82ea6d18917afa516091697a4dcd004a39 100644 --- a/ee/spec/requests/admin/gitlab_duo_controller_spec.rb +++ b/ee/spec/requests/admin/gitlab_duo_controller_spec.rb @@ -95,7 +95,7 @@ context 'when instance is on GitLab.com' do before do - allow(Gitlab).to receive(:com?).and_return(true) + stub_saas_features(gitlab_com_subscriptions: true) end it_behaves_like 'hides gitlab duo path'