Skip to content

Commit 867099c

Browse files
committed
Read auth keys file from config
1 parent 502f771 commit 867099c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/gitlab_keys_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
end
2121

2222
it "should receive valid cmd" do
23-
valid_cmd = "echo 'command=\"#{ROOT_PATH}/bin/gitlab-shell key-741\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaDAxx2E' >> /home/git/.ssh/authorized_keys"
23+
valid_cmd = "echo 'command=\"#{ROOT_PATH}/bin/gitlab-shell key-741\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaDAxx2E' >> {GitlabConfig.new.auth_file}"
2424
@gl_keys.should_receive(:system).with(valid_cmd)
2525
@gl_keys.send :add_key
2626
end
@@ -33,7 +33,7 @@
3333
end
3434

3535
it "should receive valid cmd" do
36-
valid_cmd = "sed -i '/key-741/d' /home/git/.ssh/authorized_keys"
36+
valid_cmd = "sed -i '/key-741/d' {GitlabConfig.new.auth_file}"
3737
@gl_keys.should_receive(:system).with(valid_cmd)
3838
@gl_keys.send :rm_key
3939
end

0 commit comments

Comments
 (0)