Commit 867099c3 authored by Michael's avatar Michael

Read auth keys file from config

parent 502f771d
...@@ -20,7 +20,7 @@ describe GitlabKeys do ...@@ -20,7 +20,7 @@ describe GitlabKeys do
end end
it "should receive valid cmd" do it "should receive valid cmd" do
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" 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}"
@gl_keys.should_receive(:system).with(valid_cmd) @gl_keys.should_receive(:system).with(valid_cmd)
@gl_keys.send :add_key @gl_keys.send :add_key
end end
...@@ -33,7 +33,7 @@ describe GitlabKeys do ...@@ -33,7 +33,7 @@ describe GitlabKeys do
end end
it "should receive valid cmd" do it "should receive valid cmd" do
valid_cmd = "sed -i '/key-741/d' /home/git/.ssh/authorized_keys" valid_cmd = "sed -i '/key-741/d' {GitlabConfig.new.auth_file}"
@gl_keys.should_receive(:system).with(valid_cmd) @gl_keys.should_receive(:system).with(valid_cmd)
@gl_keys.send :rm_key @gl_keys.send :rm_key
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment