lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb in brightbox-cli-0.17.1 vs lib/brightbox-cli/vendor/fog/tests/aws/requests/iam/user_tests.rb in brightbox-cli-0.17.2

- old
+ new

@@ -1,10 +1,8 @@ Shindo.tests('AWS::IAM | user requests', ['aws']) do - unless Fog.mocking? - Fog::AWS[:iam].create_group('fog_user_tests') - end + Fog::AWS[:iam].create_group('fog_user_tests') tests('success') do @user_format = { 'User' => { @@ -15,11 +13,10 @@ }, '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' => [{ @@ -31,35 +28,45 @@ '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 + @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 - 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 + Fog::AWS[:iam].delete_group('fog_user_tests') -end \ No newline at end of file +end