Commit 279cf39301be499c1d5742cf66a1a2601e545943
- Date: Sun Jan 20 23:07:58 +0000 2008
- Committer: Johan Sørensen (johan@johansorensen.com)
- Author: Johan Sørensen (johan@johansorensen.com)
- Commit SHA1: 279cf39301be499c1d5742cf66a1a2601e545943
- Tree SHA1: bc470d733668372d1c1fdabd583ba09fe0fe911d
finish with newline in SshKey#to_key
Commit diff
| |   |
| 20 | 20 | %Q{### START KEY #{self.id || "nil"} ###\n} + |
| 21 | 21 | %Q{command="gitorious #{user.login}",no-port-forwarding,} + |
| 22 | 22 | %Q{no-X11-forwarding,no-agent-forwarding,no-pty #{key}} + |
| 23 | | %Q{\n### END KEY #{self.id || "nil"} ###} |
| 23 | %Q{\n### END KEY #{self.id || "nil"} ###\n} |
| 24 | 24 | end |
| 25 | 25 | |
| 26 | 26 | def self.add_to_authorized_keys(keydata, key_file_class=SshKeyFile) |
| toggle raw diff |
--- a/app/models/ssh_key.rb
+++ b/app/models/ssh_key.rb
@@ -20,7 +20,7 @@ class SshKey < ActiveRecord::Base
%Q{### START KEY #{self.id || "nil"} ###\n} +
%Q{command="gitorious #{user.login}",no-port-forwarding,} +
%Q{no-X11-forwarding,no-agent-forwarding,no-pty #{key}} +
- %Q{\n### END KEY #{self.id || "nil"} ###}
+ %Q{\n### END KEY #{self.id || "nil"} ###\n}
end
def self.add_to_authorized_keys(keydata, key_file_class=SshKeyFile) |
| |   |
| 78 | 78 | exp_key = %Q{### START KEY #{ssh_key.id} ###\n} + |
| 79 | 79 | %Q{command="gitorious #{users(:johan).login}",no-port-forwarding,} + |
| 80 | 80 | %Q{no-X11-forwarding,no-agent-forwarding,no-pty #{ssh_key.key}} + |
| 81 | | %Q{\n### END KEY #{ssh_key.id} ###} |
| 81 | %Q{\n### END KEY #{ssh_key.id} ###\n} |
| 82 | 82 | ssh_key.to_key.should == exp_key |
| 83 | 83 | end |
| 84 | 84 | |
| toggle raw diff |
--- a/spec/models/ssh_key_spec.rb
+++ b/spec/models/ssh_key_spec.rb
@@ -78,7 +78,7 @@ describe SshKey do
exp_key = %Q{### START KEY #{ssh_key.id} ###\n} +
%Q{command="gitorious #{users(:johan).login}",no-port-forwarding,} +
%Q{no-X11-forwarding,no-agent-forwarding,no-pty #{ssh_key.key}} +
- %Q{\n### END KEY #{ssh_key.id} ###}
+ %Q{\n### END KEY #{ssh_key.id} ###\n}
ssh_key.to_key.should == exp_key
end
|