summaryrefslogtreecommitdiff
path: root/spec/controllers/groups
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2018-09-10 23:57:03 +0200
committerTomasz Maczukin <tomasz@maczukin.pl>2018-10-04 08:37:01 +0200
commit42af229510adfef78772d5ec1cba9b990a645ac3 (patch)
treeb85e1912d72204811cad14936f00949c7d99aa74 /spec/controllers/groups
parentdfb9ac3a5f97a4c556bacea78174836fe7d39145 (diff)
downloadgitlab-ce-42af229510adfef78772d5ec1cba9b990a645ac3.tar.gz
Simplify runner registration token resetting
This icommit adds several changes related to the same topic - resetting a Runner registration token: 1. On Project settings page it adds a button for resetting the registration token and it removes the Runner token field that was confusing all GitLab users. 2. On Group settings page it adds the same button for resetting the registration token. 3. On Admin Runners settings page it moves the button to the same place as in Project and Group settings and it changes slightly the page layout to make it more similar to Group and Project setting pages. 4. It refactorizes a little the partial that prints runner registration description. Thanks to this Project, Group and Admin settings of the Runner are re-using the same code to generate the button. 5. Updates the translations of changed text.
Diffstat (limited to 'spec/controllers/groups')
-rw-r--r--spec/controllers/groups/settings/ci_cd_controller_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/groups/settings/ci_cd_controller_spec.rb b/spec/controllers/groups/settings/ci_cd_controller_spec.rb
index ea18122e0c3..06ccace8242 100644
--- a/spec/controllers/groups/settings/ci_cd_controller_spec.rb
+++ b/spec/controllers/groups/settings/ci_cd_controller_spec.rb
@@ -17,4 +17,18 @@ describe Groups::Settings::CiCdController do
expect(response).to render_template(:show)
end
end
+
+ describe 'PUT #reset_registration_token' do
+ subject { put :reset_registration_token, group_id: group }
+
+ it 'resets runner registration token' do
+ expect { subject }.to change { group.reload.runners_token }
+ end
+
+ it 'redirects the user to admin runners page' do
+ subject
+
+ expect(response).to redirect_to(group_settings_ci_cd_path)
+ end
+ end
end