Commit 519941d6 authored by Stan Hu's avatar Stan Hu

Hide "Buy additional minutes" button for self-managed installs

This button only pertains to GitLab.com, so it should not be seen
by other installations.

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/12864
parent c59a4eea
......@@ -16,7 +16,7 @@
%a.nav-link#storage-quota{ data: { toggle: "tab", action: '#storage-quota-tab' }, href: '#storage-quota-tab', 'aria-controls': '#storage-quota-tab', 'aria-selected': false }
= s_('UsageQuota|Storage')
.nav-controls
= link_to s_('UsageQuota|Buy additional minutes'), EE::SUBSCRIPTIONS_PLANS_URL, target: '_blank', class: 'btn btn-inverted btn-success float-right'
= link_to s_('UsageQuota|Buy additional minutes'), EE::SUBSCRIPTIONS_PLANS_URL, target: '_blank', class: 'btn btn-inverted btn-success float-right' if ::Gitlab.com?
.tab-content
.tab-pane#pipelines-quota-tab
......
---
title: Hide "Buy additional minutes" button for self-managed installs
merge_request: 14826
author:
type: fixed
......@@ -4,8 +4,11 @@ describe 'Groups > Usage Quotas' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:project) { create(:project, namespace: group, shared_runners_enabled: true) }
let(:gitlab_dot_com) { true }
before do
allow(Gitlab).to receive(:com?).and_return(gitlab_dot_com)
group.add_owner(user)
sign_in(user)
end
......@@ -111,9 +114,21 @@ describe 'Groups > Usage Quotas' do
include_examples 'linked in group settings dropdown'
context 'when it is not GitLab.com' do
let(:gitlab_dot_com) { false }
it "does not show 'Buy additional minutes' button" do
visit_pipeline_quota_page
expect(page).not_to have_content('Buy additional minutes')
end
end
it 'shows correct group quota and projects info' do
visit_pipeline_quota_page
expect(page).to have_content('Buy additional minutes')
page.within('.pipeline-quota') do
expect(page).to have_content("1000 / 500 minutes")
expect(page).to have_content("200% used")
......
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