Sha256: ec01b18aa2a4c4bc4a94b5cd1666b506a85f80d87761d98e40d9e76da63d30ec

Contents?: true

Size: 1.37 KB

Versions: 9

Compression:

Stored size: 1.37 KB

Contents

Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do

  Fog.mock!
  @iam = Fog::AWS[:iam]
  @user_one_name = 'fake_user_one'
  @user_two_name = 'fake_user_two'
  
  tests('#create').succeeds do
    @user_one = @iam.users.create(:id => @user_one_name)
    @user_one.id == @user_one_name
  end
  
  tests('#all','there is only one user').succeeds do
    @iam.users.size == 1
  end
  
  tests('#all','the only user should match').succeeds do
    @iam.users.first.id == @user_one_name
  end
  
  tests('#create','a second user').succeeds do
    @user_two = @iam.users.create(:id => @user_two_name)
    @user_two.id == @user_two_name
  end  

  tests('#all','there are two users').succeeds do
    @iam.users.size == 2
  end

  tests('#get','an existing user').succeeds do
    @iam.users.get(@user_one_name).id == @user_one_name
  end

  tests('#get',"returns nil if the user doesn't exists").succeeds do
    @iam.users.get('non-exists') == nil
  end
  
  tests('#policies','it has no policies').succeeds do
    @iam.users.get(@user_one_name).policies.empty?
  end
  
  tests('#access_keys','it has no keys').succeeds do
    @iam.users.get(@user_one_name).access_keys.empty?
  end
  
  tests('#destroy','an existing user').succeeds do
    @iam.users.get(@user_one_name).destroy
  end
  
  tests('#destroy','clean up remaining user').succeeds do
    @iam.users.get(@user_two_name).destroy
  end
  
end

Version data entries

9 entries across 9 versions & 5 rubygems

Version Path
fog-parser-fix-1.6.1 tests/aws/models/iam/users_tests.rb
fog-test-again-1.6.0 tests/aws/models/iam/users_tests.rb
fog-parser-fix-1.6.0 tests/aws/models/iam/users_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/aws/models/iam/users_tests.rb
fog-1.7.0 tests/aws/models/iam/users_tests.rb
fog-1.6.0 tests/aws/models/iam/users_tests.rb
fog-1.5.0 tests/aws/models/iam/users_tests.rb
rackspace-fog-1.4.2 tests/aws/models/iam/users_tests.rb
fog-1.4.0 tests/aws/models/iam/users_tests.rb