Permalink
Browse files

fix key spec

  • Loading branch information...
1 parent c63d07e commit a86993a83b7f7646ac13cb3c638ad54c892aa104 @timfel timfel committed Jan 30, 2010
Showing with 2 additions and 1 deletion.
  1. +1 −1 lib/bithug/key.rb
  2. +1 −0 spec/bithug/key_spec.rb
View
@@ -16,6 +16,7 @@ class Bithug::Key < Ohm::Model
def remove(user)
self.delete
+ user.ssh_keys.delete(self)
# BUG: SANITIZE USERNAME FOR REGEX!
File.open(KEYS_FILE+Time.now.to_i.to_s, 'w') do |out|
File.open(KEYS_FILE, 'r+') do |infile|
@@ -35,7 +36,6 @@ def save
def safe?
return false if value.include? "\n"
- pp value.split
type, blob = value.split
return false if blob.nil? || type.nil?
blob = blob.unpack("m*").first
View
@@ -32,6 +32,7 @@
end
it "should delete a present key from a user" do
+ @user.ssh_keys.clear
@user.ssh_keys.size.should == 0
key = subject.add(:user => @user, :name => 'Test' , :value => @value)
@user.ssh_keys.should include(key)

0 comments on commit a86993a

Please sign in to comment.