Commit 241678fd authored by Mike Greiling's avatar Mike Greiling

show only projects with shared runners enabled on pipeline quota page, add tests

parent 9d67094b
...@@ -4,6 +4,6 @@ class Groups::PipelineQuotaController < Groups::ApplicationController ...@@ -4,6 +4,6 @@ class Groups::PipelineQuotaController < Groups::ApplicationController
layout 'group_settings' layout 'group_settings'
def index def index
@projects = @group.projects.page(params[:page]) @projects = @group.projects.where(shared_runners_enabled: true).page(params[:page])
end end
end end
...@@ -40,6 +40,6 @@ ...@@ -40,6 +40,6 @@
- if @projects.blank? - if @projects.blank?
%tr %tr
%td{colspan: 2} %td{colspan: 2}
.nothing-here-block This group has no projects .nothing-here-block This group has no projects which use shared runners
= paginate @projects, theme: "gitlab" = paginate @projects, theme: "gitlab"
...@@ -21,7 +21,7 @@ feature 'Groups > Pipeline Quota', feature: true do ...@@ -21,7 +21,7 @@ feature 'Groups > Pipeline Quota', feature: true do
end end
end end
it 'shows correct ratio and status' do it 'shows correct group quota info' do
visit_pipeline_quota_page visit_pipeline_quota_page
page.within('.pipeline-quota') do page.within('.pipeline-quota') do
...@@ -43,13 +43,17 @@ feature 'Groups > Pipeline Quota', feature: true do ...@@ -43,13 +43,17 @@ feature 'Groups > Pipeline Quota', feature: true do
end end
end end
it 'shows correct ratio and status' do it 'shows correct group quota info' do
visit_pipeline_quota_page visit_pipeline_quota_page
page.within('.pipeline-quota') do page.within('.pipeline-quota') do
expect(page).to have_content("300 / Unlimited minutes") expect(page).to have_content("300 / Unlimited minutes")
expect(page).to have_selector('.progress-bar-success') expect(page).to have_selector('.progress-bar-success')
end end
page.within('.pipeline-project-metrics') do
expect(page).to have_content('This group has no projects which use shared runners')
end
end end
end end
...@@ -64,7 +68,7 @@ feature 'Groups > Pipeline Quota', feature: true do ...@@ -64,7 +68,7 @@ feature 'Groups > Pipeline Quota', feature: true do
end end
end end
it 'shows correct ratio and status' do it 'shows correct group quota info' do
visit_pipeline_quota_page visit_pipeline_quota_page
page.within('.pipeline-quota') do page.within('.pipeline-quota') do
...@@ -77,6 +81,7 @@ feature 'Groups > Pipeline Quota', feature: true do ...@@ -77,6 +81,7 @@ feature 'Groups > Pipeline Quota', feature: true do
context 'minutes over quota' do context 'minutes over quota' do
let(:group) { create(:group, :with_used_build_minutes_limit) } let(:group) { create(:group, :with_used_build_minutes_limit) }
let!(:other_project) { create(:empty_project, namespace: group, shared_runners_enabled: false) }
it 'is linked within the group settings dropdown' do it 'is linked within the group settings dropdown' do
visit group_path(group) visit group_path(group)
...@@ -86,7 +91,7 @@ feature 'Groups > Pipeline Quota', feature: true do ...@@ -86,7 +91,7 @@ feature 'Groups > Pipeline Quota', feature: true do
end end
end end
it 'shows correct ratio and status' do it 'shows correct group quota and projects info' do
visit_pipeline_quota_page visit_pipeline_quota_page
page.within('.pipeline-quota') do page.within('.pipeline-quota') do
...@@ -94,6 +99,11 @@ feature 'Groups > Pipeline Quota', feature: true do ...@@ -94,6 +99,11 @@ feature 'Groups > Pipeline Quota', feature: true do
expect(page).to have_content("200% used") expect(page).to have_content("200% used")
expect(page).to have_selector('.progress-bar-danger') expect(page).to have_selector('.progress-bar-danger')
end end
page.within('.pipeline-project-metrics') do
expect(page).to have_content(project.name)
expect(page).not_to have_content(other_project.name)
end
end end
end end
......
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