Sha256: 6b3258ad411c845f97cd0a303fdcdc8345ce87056fc38d184072e30b039ebf86

Contents?: true

Size: 967 Bytes

Versions: 13

Compression:

Stored size: 967 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper.rb'

describe User do
  before :each do
    @user = User.new(:name => 'bob')
  end
  
  it "should merge multiple keys into the authorized_keys file" do
    user = User.create
    key1 = 'this is'
    key2 = ' a key.'
    
    user.keys.create(:public_key => key1)
    user.keys.create(:public_key => key2)
    
    user.authorized_keys_file.should == key1 + key2
  end
  
  it "should raise an error if the authorized_keys_file is blank" do
    lambda { @user.authorized_keys_file }.should raise_error
  end
  
  it "can generate the user's home directory path" do
    @user.home_directory_path.should == '/home/bob/'
  end
  
  it "can generate the path to the user's .ssh directory" do
    @user.ssh_config_directory_path.should == '/home/bob/.ssh/'
  end
  
  it "can generate the path to the user's authorized_keys file" do
    @user.authorized_keys_file_path.should == '/home/bob/.ssh/authorized_keys'
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fabric-0.4.4 spec/classes/user_spec.rb
fabric-0.4.3 spec/classes/user_spec.rb
fabric-0.4.2 spec/classes/user_spec.rb
fabric-0.4.1 spec/classes/user_spec.rb
fabric-0.4.0 spec/classes/user_spec.rb
fabric-0.3.6 spec/classes/user_spec.rb
fabric-0.3.5 spec/classes/user_spec.rb
fabric-0.3.4 spec/classes/user_spec.rb
fabric-0.3.3 spec/classes/user_spec.rb
fabric-0.3.2 spec/classes/user_spec.rb
fabric-0.3.1 spec/classes/user_spec.rb
fabric-0.3.0 spec/classes/user_spec.rb
fabric-0.2.0 spec/classes/user_spec.rb