Sha256: 6eecfdb311a072779b28b0533b12801fa4c6d32de92f4ee9ae5a94fb256b6c4a

Contents?: true

Size: 1.95 KB

Versions: 55

Compression:

Stored size: 1.95 KB

Contents

Shindo.tests('AWS::IAM | user requests', ['aws']) do

  Fog::AWS[:iam].create_group('fog_user_tests')

  tests('success') do

    @user_format = {
      'User' => {
        'Arn'        => String,
        'Path'       => String,
        'UserId'     => String,
        'UserName'   => String,
        'CreateDate' => Time
      },
      'RequestId' => String
    }

    tests("#create_user('fog_user')").formats(@user_format) do
      Fog::AWS[:iam].create_user('fog_user').body
    end

    @users_format = {
      'Users' => [{
        'Arn'        => String,
        'Path'       => String,
        'UserId'     => String,
        'UserName'   => String,
        'CreateDate' => Time
      }],
      'IsTruncated' => Fog::Boolean,
      'RequestId'   => String
    }

    tests("#list_users").formats(@users_format) do
      Fog::AWS[:iam].list_users.body
    end

    tests("#get_user").formats(@user_format) do
      Fog::AWS[:iam].get_user('fog_user').body
    end

    tests("#add_user_to_group('fog_user_tests', 'fog_user')").formats(AWS::IAM::Formats::BASIC) do
      Fog::AWS[:iam].add_user_to_group('fog_user_tests', 'fog_user').body
    end

    @groups_format = {
      'GroupsForUser' => [{
        'Arn'       => String,
        'GroupId'   => String,
        'GroupName' => String,
        'Path'      => String
      }],
      'IsTruncated' => Fog::Boolean,
      'RequestId'   => String
    }

    tests("#list_groups_for_user('fog_user')").formats(@groups_format) do
      Fog::AWS[:iam].list_groups_for_user('fog_user').body
    end

    tests("#remove_user_from_group('fog_user_tests', 'fog_user')").formats(AWS::IAM::Formats::BASIC) do
      Fog::AWS[:iam].remove_user_from_group('fog_user_tests', 'fog_user').body
    end

    tests("#delete_user('fog_user')").formats(AWS::IAM::Formats::BASIC) do
      Fog::AWS[:iam].delete_user('fog_user').body
    end


  end

  tests('failure') do
    test('failing conditions')
  end

  Fog::AWS[:iam].delete_group('fog_user_tests')

end

Version data entries

55 entries across 55 versions & 3 rubygems

Version Path
fog-1.22.0 tests/aws/requests/iam/user_tests.rb
fog-1.21.0 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/aws/requests/iam/user_tests.rb
fog-1.20.0 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/aws/requests/iam/user_tests.rb
fog-1.19.0 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/aws/requests/iam/user_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/aws/requests/iam/user_tests.rb