diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-01 13:10:46 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-07-06 19:39:03 +0300 |
commit | 2a7ea3417310d450cc21a07f7d61b822d3da9011 (patch) | |
tree | ec1a8895ca9135a2beffe9442fe2cb41fe8b5a8d /spec | |
parent | 71212ecea6aee0365c336a596fbb3f593dfaf4ab (diff) |
Merge branch 'enable-shared-runners-with-admins' into 'master'
Admin should be able to turn shared runners into specific ones:
## What does this MR do?
Make sure admins could turn shared runners into specific runners.
## Are there points in the code the reviewer needs to double check?
Is this the desired behaviour?
## Why was this MR needed?
Closes #19039
Closes #19272
![Screen_Shot_2016-06-30_at_9.30.05_PM](/uploads/97eb3b4923fd4e498b1f8ca70b1345c8/Screen_Shot_2016-06-30_at_9.30.05_PM.png)
See merge request !4961
(cherry picked from commit b569f842b37434efd0cbae4b0c197391e0610b12)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/admin/admin_runners_spec.rb | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index 2d297776cb0..2f82fafc13a 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -62,19 +62,45 @@ describe "Admin Runners" do end describe 'enable/create' do - before do - @project1.runners << runner - visit admin_runner_path(runner) + shared_examples 'assignable runner' do + it 'enables a runner for a project' do + within '.unassigned-projects' do + click_on 'Enable' + end + + assigned_project = page.find('.assigned-projects') + + expect(assigned_project).to have_content(@project2.path) + end end - it 'enables specific runner for project' do - within '.unassigned-projects' do - click_on 'Enable' + context 'with specific runner' do + before do + @project1.runners << runner + visit admin_runner_path(runner) end - assigned_project = page.find('.assigned-projects') + it_behaves_like 'assignable runner' + end + + context 'with locked runner' do + before do + runner.update(locked: true) + @project1.runners << runner + visit admin_runner_path(runner) + end + + it_behaves_like 'assignable runner' + end + + context 'with shared runner' do + before do + @project1.destroy + runner.update(is_shared: true) + visit admin_runner_path(runner) + end - expect(assigned_project).to have_content(@project2.path) + it_behaves_like 'assignable runner' end end |