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>2020-03-12 15:09:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 15:09:17 +0300
commitcd52759ee33051b8ad7b88b02ba7954e4fad7018 (patch)
treef1096c68e457aef7f5201acd16e4a751ff538026 /spec/workers/gitlab_shell_worker_spec.rb
parent18f7828977b74bf6e5153594a098ef90e773b3b7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/gitlab_shell_worker_spec.rb')
-rw-r--r--spec/workers/gitlab_shell_worker_spec.rb33
1 files changed, 28 insertions, 5 deletions
diff --git a/spec/workers/gitlab_shell_worker_spec.rb b/spec/workers/gitlab_shell_worker_spec.rb
index 5dedf5be9fa..f5884e5e8f8 100644
--- a/spec/workers/gitlab_shell_worker_spec.rb
+++ b/spec/workers/gitlab_shell_worker_spec.rb
@@ -5,12 +5,35 @@ require 'spec_helper'
describe GitlabShellWorker do
let(:worker) { described_class.new }
- describe '#perform with add_key' do
- it 'calls add_key on Gitlab::Shell' do
- expect_next_instance_of(Gitlab::Shell) do |instance|
- expect(instance).to receive(:add_key).with('foo', 'bar')
+ describe '#perform' do
+ describe '#add_key' do
+ it 'delegates to Gitlab::AuthorizedKeys' do
+ expect_next_instance_of(Gitlab::AuthorizedKeys) do |instance|
+ expect(instance).to receive(:add_key).with('foo', 'bar')
+ end
+
+ worker.perform(:add_key, 'foo', 'bar')
+ end
+ end
+
+ describe '#remove_key' do
+ it 'delegates to Gitlab::AuthorizedKeys' do
+ expect_next_instance_of(Gitlab::AuthorizedKeys) do |instance|
+ expect(instance).to receive(:remove_key).with('foo', 'bar')
+ end
+
+ worker.perform(:remove_key, 'foo', 'bar')
+ end
+ end
+
+ describe 'all other commands' do
+ it 'delegates them to Gitlab::Shell' do
+ expect_next_instance_of(Gitlab::Shell) do |instance|
+ expect(instance).to receive(:foo).with('bar', 'baz')
+ end
+
+ worker.perform(:foo, 'bar', 'baz')
end
- worker.perform(:add_key, 'foo', 'bar')
end
end
end