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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-28 18:09:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-28 18:09:27 +0300
commit3a25b40d5572a1de4220a9bd284025bf5be1d16b (patch)
tree748ec93e09ada6def17ac87b4b8479dccab20d37 /spec/tasks
parent22fd199237e247c36de5b982d444cedc194126e6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/shell_rake_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/shell_rake_spec.rb b/spec/tasks/gitlab/shell_rake_spec.rb
index 52a9738fb51..195859eac70 100644
--- a/spec/tasks/gitlab/shell_rake_spec.rb
+++ b/spec/tasks/gitlab/shell_rake_spec.rb
@@ -22,4 +22,23 @@ RSpec.describe 'gitlab:shell rake tasks', :silence_stdout do
run_rake_task('gitlab:shell:install')
end
end
+
+ describe 'setup task' do
+ it 'writes authorized keys into the file' do
+ allow(Gitlab::CurrentSettings).to receive(:authorized_keys_enabled?).and_return(true)
+ stub_env('force', 'yes')
+
+ auth_key = create(:key)
+ auth_and_signing_key = create(:key, usage_type: :auth_and_signing)
+ create(:key, usage_type: :signing)
+
+ expect_next_instance_of(Gitlab::AuthorizedKeys) do |instance|
+ expect(instance).to receive(:batch_add_keys).once do |keys|
+ expect(keys).to match_array([auth_key, auth_and_signing_key])
+ end
+ end
+
+ run_rake_task('gitlab:shell:setup')
+ end
+ end
end