Commit 102a1774 authored by Takuya Noguchi's avatar Takuya Noguchi Committed by Rémy Coutable

Add explicit message when no runners on admin

parent db8ad863
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
%br %br
- if @runners.any?
.table-holder .table-holder
%table.table %table.table
%thead %thead
...@@ -75,3 +76,5 @@ ...@@ -75,3 +76,5 @@
- @runners.each do |runner| - @runners.each do |runner|
= render "admin/runners/runner", runner: runner = render "admin/runners/runner", runner: runner
= paginate @runners, theme: "gitlab" = paginate @runners, theme: "gitlab"
- else
.nothing-here-block No runners found
---
title: Add explicit message when no runners on admin
merge_request: 12266
author: Takuya Noguchi
...@@ -9,9 +9,11 @@ describe "Admin Runners" do ...@@ -9,9 +9,11 @@ describe "Admin Runners" do
end end
describe "Runners page" do describe "Runners page" do
let(:pipeline) { create(:ci_pipeline) }
context "when there are runners" do
before do before do
runner = FactoryGirl.create(:ci_runner, contacted_at: Time.now) runner = FactoryGirl.create(:ci_runner, contacted_at: Time.now)
pipeline = FactoryGirl.create(:ci_pipeline)
FactoryGirl.create(:ci_build, pipeline: pipeline, runner_id: runner.id) FactoryGirl.create(:ci_build, pipeline: pipeline, runner_id: runner.id)
visit admin_runners_path visit admin_runners_path
end end
...@@ -25,16 +27,37 @@ describe "Admin Runners" do ...@@ -25,16 +27,37 @@ describe "Admin Runners" do
before do before do
FactoryGirl.create :ci_runner, description: 'runner-foo' FactoryGirl.create :ci_runner, description: 'runner-foo'
FactoryGirl.create :ci_runner, description: 'runner-bar' FactoryGirl.create :ci_runner, description: 'runner-bar'
end
it 'shows correct runner when description matches' do
search_form = find('#runners-search') search_form = find('#runners-search')
search_form.fill_in 'search', with: 'runner-foo' search_form.fill_in 'search', with: 'runner-foo'
search_form.click_button 'Search' search_form.click_button 'Search'
end
it 'shows correct runner' do
expect(page).to have_content("runner-foo") expect(page).to have_content("runner-foo")
expect(page).not_to have_content("runner-bar") expect(page).not_to have_content("runner-bar")
end end
it 'shows no runner when description does not match' do
search_form = find('#runners-search')
search_form.fill_in 'search', with: 'runner-baz'
search_form.click_button 'Search'
expect(page).to have_text 'No runners found'
end
end
end
context "when there are no runners" do
before do
visit admin_runners_path
end
it 'has all necessary texts including no runner message' do
expect(page).to have_text "To register a new Runner"
expect(page).to have_text "Runners with last contact more than a minute ago: 0"
expect(page).to have_text 'No runners found'
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