1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/tests/requests/rds/event_subscription_tests.rb

31 lines
1.4 KiB
Ruby
Raw Normal View History

Shindo.tests('Aws::RDS | event subscription requests', ['aws', 'rds']) do
pending unless Fog.mocking?
@name = 'fog'
@arn = 'arn:aws:sns:us-east-1:12345678910:fog'
tests('success') do
tests('#create_event_subscription').formats(Aws::RDS::Formats::CREATE_EVENT_SUBSCRIPTION) do
body = Fog::AWS[:rds].create_event_subscription('SubscriptionName' => @name, 'SnsTopicArn' => @arn).body
returns(@name) { body['CreateEventSubscriptionResult']['EventSubscription']['CustSubscriptionId'] }
returns('creating') { body['CreateEventSubscriptionResult']['EventSubscription']['Status'] }
body
end
tests("#describe_event_subscriptions").formats(Aws::RDS::Formats::DESCRIBE_EVENT_SUBSCRIPTIONS) do
returns('active') { Fog::AWS[:rds].describe_event_subscriptions.body['DescribeEventSubscriptionsResult']['EventSubscriptionsList'].first['Status'] }
Fog::AWS[:rds].describe_event_subscriptions.body
end
tests("#delete_event_subscription").formats(Aws::RDS::Formats::BASIC) do
body = Fog::AWS[:rds].delete_event_subscription(@name).body
returns('deleting') { Fog::AWS[:rds].describe_event_subscriptions('SubscriptionName' => @name).body['DescribeEventSubscriptionsResult']['EventSubscriptionsList'].first['Status'] }
raises(Fog::AWS::RDS::NotFound) { Fog::AWS[:rds].describe_event_subscriptions('SubscriptionName' => @name) }
body
end
end
end