Sha256: a83761678aabeea1bc9a0fa7566b6d589cf02646ca7701fb670fbeffafe43176

Contents?: true

Size: 1.34 KB

Versions: 53

Compression:

Stored size: 1.34 KB

Contents

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

  service     = Fog::AWS[:iam]
  group_name  = uniq_id('fog-test-group')
  policy_name = uniq_id('fog-test-policy')
  group       = nil
  document    = {"Statement" => [{"Effect" => "Allow", "Action" => "*", "Resource" => "*"}]}

  tests('#create').succeeds do
    group = service.groups.create(:name => group_name)

    group.name == group_name
  end

  tests('#all').succeeds do
    service.groups.all.map(&:name).include?(group_name)
  end

  tests('update').succeeds do
    new_path = group.path = "/newpath/"
    group.save

    group.reload.path == new_path
  end

  tests('group') do
    policy = nil

    tests('#policies', '#create') do
      policy = group.policies.create(:id => policy_name, :document => document)
    end

    tests('#policies', '#get').succeeds do
      group.policies.get(policy_name) != nil
    end

    tests('#policies', '#all').succeeds do
      group.policies.all.map(&:id).include?(policy.id)
    end

    tests('#users', 'when none').succeeds do
      group.users.empty?
    end

    user = nil

    tests('#add_user').succeeds do
      user = service.users.create(:id => 'fog-test')

      group.add_user(user)

      group.users.include?(user)
    end

    tests('#users').succeeds do
      group.reload.users.map(&:identity).include?(user.identity)
    end
  end
end

Version data entries

53 entries across 51 versions & 3 rubygems

Version Path
fog-aws-3.12.0 tests/models/iam/groups_tests.rb
fog-aws-3.11.0 tests/models/iam/groups_tests.rb
fog-aws-3.10.0 tests/models/iam/groups_tests.rb
fog-aws-3.9.0 tests/models/iam/groups_tests.rb
fog-aws-3.8.0 tests/models/iam/groups_tests.rb
fog-aws-3.7.0 tests/models/iam/groups_tests.rb
fog-aws-3.6.7 tests/models/iam/groups_tests.rb
fog-aws-3.6.6 tests/models/iam/groups_tests.rb
fog-aws-3.6.5 tests/models/iam/groups_tests.rb
fog-aws-3.6.4 tests/models/iam/groups_tests.rb
fog-aws-3.6.3 tests/models/iam/groups_tests.rb
fog-aws-3.6.2 tests/models/iam/groups_tests.rb
fog-aws-3.5.2 tests/models/iam/groups_tests.rb
fog-aws-3.5.1 tests/models/iam/groups_tests.rb
fog-aws-3.5.0 tests/models/iam/groups_tests.rb
fog-aws-3.4.0 tests/models/iam/groups_tests.rb
fog-aws-3.3.0 tests/models/iam/groups_tests.rb
fog-aws-3.2.0 tests/models/iam/groups_tests.rb
fog-aws-3.1.0 tests/models/iam/groups_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aws-2.0.1/tests/models/iam/groups_tests.rb