Commit fd9597d4 authored by Mike Greiling's avatar Mike Greiling

add ci limit warnings to project pipelines page

parent 727818b1
- @no_container = true - @no_container = true
- page_title "Pipelines" - page_title "Pipelines"
= content_for :flash_message do
= render 'shared/shared_runner_minutes_limit', project: @project
= render "projects/pipelines/head" = render "projects/pipelines/head"
%div{ class: container_class } %div{ class: container_class }
......
...@@ -16,7 +16,12 @@ feature 'CI shared runner limits', feature: true do ...@@ -16,7 +16,12 @@ feature 'CI shared runner limits', feature: true do
context 'without limit' do context 'without limit' do
scenario 'it does not display a warning message on project homepage' do scenario 'it does not display a warning message on project homepage' do
visit namespace_project_path(project.namespace, project) visit_project_home
expect_no_quota_exceeded_alert
end
scenario 'it does not display a warning message on pipelines page' do
visit_project_pipelines
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
end end
...@@ -26,7 +31,12 @@ feature 'CI shared runner limits', feature: true do ...@@ -26,7 +31,12 @@ feature 'CI shared runner limits', feature: true do
let(:group) { create(:group, :with_used_build_minutes_limit) } let(:group) { create(:group, :with_used_build_minutes_limit) }
scenario 'it displays a warning message on project homepage' do scenario 'it displays a warning message on project homepage' do
visit namespace_project_path(project.namespace, project) visit_project_home
expect_quota_exceeded_alert("#{group.name} has exceeded their build minutes quota.")
end
scenario 'it displays a warning message on pipelines page' do
visit_project_pipelines
expect_quota_exceeded_alert("#{group.name} has exceeded their build minutes quota.") expect_quota_exceeded_alert("#{group.name} has exceeded their build minutes quota.")
end end
end end
...@@ -35,7 +45,12 @@ feature 'CI shared runner limits', feature: true do ...@@ -35,7 +45,12 @@ feature 'CI shared runner limits', feature: true do
let(:group) { create(:group, :with_not_used_build_minutes_limit) } let(:group) { create(:group, :with_not_used_build_minutes_limit) }
scenario 'it does not display a warning message on project homepage' do scenario 'it does not display a warning message on project homepage' do
visit namespace_project_path(project.namespace, project) visit_project_home
expect_no_quota_exceeded_alert
end
scenario 'it does not display a warning message on pipelines page' do
visit_project_pipelines
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
end end
...@@ -44,7 +59,12 @@ feature 'CI shared runner limits', feature: true do ...@@ -44,7 +59,12 @@ feature 'CI shared runner limits', feature: true do
let(:group) { create(:group, :with_build_minutes_limit) } let(:group) { create(:group, :with_build_minutes_limit) }
scenario 'it does not display a warning message on project homepage' do scenario 'it does not display a warning message on project homepage' do
visit namespace_project_path(project.namespace, project) visit_project_home
expect_no_quota_exceeded_alert
end
scenario 'it does not display a warning message on pipelines page' do
visit_project_pipelines
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
end end
...@@ -56,12 +76,25 @@ feature 'CI shared runner limits', feature: true do ...@@ -56,12 +76,25 @@ feature 'CI shared runner limits', feature: true do
context 'when limit is defined and limit is exceeded' do context 'when limit is defined and limit is exceeded' do
scenario 'it does not display a warning message on project homepage' do scenario 'it does not display a warning message on project homepage' do
visit namespace_project_path(project.namespace, project) visit_project_home
expect_no_quota_exceeded_alert
end
scenario 'it does not display a warning message on pipelines page' do
visit_project_pipelines
expect_no_quota_exceeded_alert expect_no_quota_exceeded_alert
end end
end end
end end
def visit_project_home
visit namespace_project_path(project.namespace, project)
end
def visit_project_pipelines
visit namespace_project_pipelines_path(project.namespace, project)
end
def expect_quota_exceeded_alert(message = nil) def expect_quota_exceeded_alert(message = nil)
expect(page).to have_selector('.shared-runner-quota-message', count: 1) expect(page).to have_selector('.shared-runner-quota-message', count: 1)
expect(page.find('.shared-runner-quota-message')).to have_content(message) unless message.nil? expect(page.find('.shared-runner-quota-message')).to have_content(message) unless message.nil?
......
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