2015-01-02 12:34:40 -05:00
|
|
|
Shindo.tests('AWS::RDS | event subscription requests', ['aws', 'rds']) do
|
2014-12-30 17:25:09 -05:00
|
|
|
pending unless Fog.mocking?
|
|
|
|
|
|
|
|
@name = 'fog'
|
|
|
|
@arn = 'arn:aws:sns:us-east-1:12345678910:fog'
|
|
|
|
|
|
|
|
tests('success') do
|
2015-01-02 12:34:40 -05:00
|
|
|
tests('#create_event_subscription').formats(AWS::RDS::Formats::CREATE_EVENT_SUBSCRIPTION) do
|
2014-12-30 17:25:09 -05:00
|
|
|
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
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("#describe_event_subscriptions").formats(AWS::RDS::Formats::DESCRIBE_EVENT_SUBSCRIPTIONS) do
|
2014-12-30 17:25:09 -05:00
|
|
|
returns('active') { Fog::AWS[:rds].describe_event_subscriptions.body['DescribeEventSubscriptionsResult']['EventSubscriptionsList'].first['Status'] }
|
|
|
|
Fog::AWS[:rds].describe_event_subscriptions.body
|
|
|
|
end
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("#delete_event_subscription").formats(AWS::RDS::Formats::BASIC) do
|
2014-12-30 17:25:09 -05:00
|
|
|
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
|