From 1dca25f4908815b752937f507beb4fbac47cf07b Mon Sep 17 00:00:00 2001 From: epdejager Date: Thu, 3 Jan 2013 12:41:34 +0200 Subject: [PATCH] Added a test for put_bucket_cors to make sure it runs in a test (mock) scenario --- tests/aws/requests/storage/bucket_tests.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/aws/requests/storage/bucket_tests.rb b/tests/aws/requests/storage/bucket_tests.rb index 922085957..9cbfe7e39 100644 --- a/tests/aws/requests/storage/bucket_tests.rb +++ b/tests/aws/requests/storage/bucket_tests.rb @@ -241,6 +241,20 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', ["aws"]) do end end + tests("put_bucket_cors('#{@aws_bucket_name}', cors)").succeeds do + cors = {'CORSConfiguration' => + [ + { + 'AllowedOrigin' => 'http://localhost:3000', + 'AllowedMethod' => ['POST', 'GET'], + 'AllowedHeader' => '*', + 'MaxAgeSeconds' => 3000 + } + ] + } + Fog::Storage[:aws].put_bucket_cors(@aws_bucket_name, cors) + end + tests("#delete_bucket('#{@aws_bucket_name}')").succeeds do Fog::Storage[:aws].delete_bucket(@aws_bucket_name) end