Commit bfc694f5 authored by Alexis Reigel's avatar Alexis Reigel

show group runners setup only to group master

parent c585004b
...@@ -20,8 +20,11 @@ ...@@ -20,8 +20,11 @@
- elsif @group_runners.empty? - elsif @group_runners.empty?
This group does not provide any group Runners yet. This group does not provide any group Runners yet.
- if can?(current_user, :admin_pipeline, @project.group)
= render partial: 'ci/runner/how_to_setup_runner', = render partial: 'ci/runner/how_to_setup_runner',
locals: { registration_token: @project.group.runners_token, type: 'group' } locals: { registration_token: @project.group.runners_token, type: 'group' }
- else
Ask your group master to setup a group Runner.
- else - else
%h4.underlined-title Available group Runners : #{@group_runners.count} %h4.underlined-title Available group Runners : #{@group_runners.count}
......
...@@ -187,6 +187,28 @@ feature 'Runners' do ...@@ -187,6 +187,28 @@ feature 'Runners' do
project.add_master(user) project.add_master(user)
end end
given(:group) { create :group }
context 'as project and group master' do
background do
group.add_master(user)
end
context 'project with a group but no group runner' do
given(:project) { create :project, group: group }
scenario 'group runners are not available' do
visit runners_path(project)
expect(page).to have_content 'This group does not provide any group Runners yet.'
expect(page).to have_content 'Setup a group Runner manually'
expect(page).not_to have_content 'Ask your group master to setup a group Runner.'
end
end
end
context 'as project master' do
context 'project without a group' do context 'project without a group' do
given(:project) { create :project } given(:project) { create :project }
...@@ -205,6 +227,9 @@ feature 'Runners' do ...@@ -205,6 +227,9 @@ feature 'Runners' do
visit runners_path(project) visit runners_path(project)
expect(page).to have_content 'This group does not provide any group Runners yet.' expect(page).to have_content 'This group does not provide any group Runners yet.'
expect(page).not_to have_content 'Setup a group Runner manually'
expect(page).to have_content 'Ask your group master to setup a group Runner.'
end end
end end
...@@ -235,4 +260,5 @@ feature 'Runners' do ...@@ -235,4 +260,5 @@ feature 'Runners' do
end end
end end
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