Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Blessing <drew@gitlab.com>2015-12-23 00:09:35 +0300
committerDrew Blessing <drew@gitlab.com>2016-12-16 18:57:05 +0300
commite0eb86ee809aaad86be4ca1d985a5e67c0657a6f (patch)
treee24cc5d86b0fcfc591bff3cdb764b2eaf49aa0ae /spec/tasks
parentbdb5e6771856c280fa1cf92b19a47fb83a4988ec (diff)
Add LDAP task to rename a provider
Sometimes admins will change the LDAP configuration, not realizing that problems will occur if the user's LDAP identities are not also updated to use the new provider name. This task will give admins a single command to run to update identities and will prevent having to run multiple Rails console queries.
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/ldap_rake_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/ldap_rake_spec.rb b/spec/tasks/gitlab/ldap_rake_spec.rb
new file mode 100644
index 00000000000..12d442b9820
--- /dev/null
+++ b/spec/tasks/gitlab/ldap_rake_spec.rb
@@ -0,0 +1,13 @@
+require 'rake_helper'
+
+describe 'gitlab:ldap:rename_provider rake task' do
+ it 'completes without error' do
+ Rake.application.rake_require 'tasks/gitlab/ldap'
+ stub_warn_user_is_not_gitlab
+ ENV['force'] = 'yes'
+
+ create(:identity) # Necessary to prevent `exit 1` from the task.
+
+ run_rake_task('gitlab:ldap:rename_provider', 'ldapmain', 'ldapfoo')
+ end
+end