Commit e678b9ef authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'sh-hide-additional-minutes' into 'master'

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

Closes #12864

See merge request gitlab-org/gitlab-ee!14826
parents 0174e3e6 519941d6
...@@ -16,7 +16,7 @@ ...@@ -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 } %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') = s_('UsageQuota|Storage')
.nav-controls .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-content
.tab-pane#pipelines-quota-tab .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 ...@@ -4,8 +4,11 @@ describe 'Groups > Usage Quotas' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let!(:project) { create(:project, namespace: group, shared_runners_enabled: true) } let!(:project) { create(:project, namespace: group, shared_runners_enabled: true) }
let(:gitlab_dot_com) { true }
before do before do
allow(Gitlab).to receive(:com?).and_return(gitlab_dot_com)
group.add_owner(user) group.add_owner(user)
sign_in(user) sign_in(user)
end end
...@@ -111,9 +114,21 @@ describe 'Groups > Usage Quotas' do ...@@ -111,9 +114,21 @@ describe 'Groups > Usage Quotas' do
include_examples 'linked in group settings dropdown' 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 it 'shows correct group quota and projects info' do
visit_pipeline_quota_page visit_pipeline_quota_page
expect(page).to have_content('Buy additional minutes')
page.within('.pipeline-quota') do page.within('.pipeline-quota') do
expect(page).to have_content("1000 / 500 minutes") expect(page).to have_content("1000 / 500 minutes")
expect(page).to have_content("200% used") 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