Sha256: 23cba7a8a55d64f1d273a81132f1160a1a27cbec421c6ae5fba6dc39d9644f9d

Contents?: true

Size: 1.6 KB

Versions: 13

Compression:

Stored size: 1.6 KB

Contents

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

  unless Fog.mocking?
    Fog::AWS[:iam].create_group('fog_user_tests')
  end

  tests('success') do

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

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

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

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

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

    tests("#remove_user_from_group('fog_user_tests', 'fog_user')").formats(AWS::IAM::Formats::BASIC) do
      pending if Fog.mocking?
      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
      pending if Fog.mocking?
      Fog::AWS[:iam].delete_user('fog_user').body
    end

  end

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

  unless Fog.mocking?
    Fog::AWS[:iam].delete_group('fog_user_tests')
  end

end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb
fog-1.1.2 tests/aws/requests/iam/user_tests.rb
fog_tractical-1.1.4 tests/aws/requests/iam/user_tests.rb
fog_tractical-1.1.3 tests/aws/requests/iam/user_tests.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb
fog-1.1.1 tests/aws/requests/iam/user_tests.rb
fog-1.1.0 tests/aws/requests/iam/user_tests.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb
tag-fog-1.0.1 tests/aws/requests/iam/user_tests.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb
fog-1.0.0 tests/aws/requests/iam/user_tests.rb