Test that files get deleted from Riak CS
This commit is contained in:
parent
b12df5470f
commit
e5dfbff82d
@ -428,10 +428,8 @@ describe "App with Riak backend" do
|
|||||||
it "removes the binary object" do
|
it "removes the binary object" do
|
||||||
last_response.status.must_equal 204
|
last_response.status.must_equal 204
|
||||||
|
|
||||||
skip "check if object is removed from Riak CS"
|
binary = cs_binary_bucket.files.get("jimmy:documents:jaypeg")
|
||||||
# lambda {
|
binary.must_be_nil
|
||||||
# binary_bucket.get("jimmy:documents:jaypeg")
|
|
||||||
# }.must_raise Riak::HTTPFailedRequest
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "logs the operation" do
|
it "logs the operation" do
|
||||||
|
@ -77,6 +77,19 @@ if app.settings.riak
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cs_client
|
||||||
|
@cs_client ||= Fog::Storage.new({
|
||||||
|
:provider => 'AWS',
|
||||||
|
:aws_access_key_id => app.settings.riak['riak_cs']['access_key'],
|
||||||
|
:aws_secret_access_key => app.settings.riak['riak_cs']['secret_key'],
|
||||||
|
:endpoint => app.settings.riak['riak_cs']['endpoint']
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
def cs_binary_bucket
|
||||||
|
@cs_binary_bucket ||= cs_client.directories.create(:key => app.settings.riak['buckets']['cs_binaries'])
|
||||||
|
end
|
||||||
|
|
||||||
def purge_all_buckets
|
def purge_all_buckets
|
||||||
[data_bucket, directory_bucket, auth_bucket, binary_bucket, opslog_bucket].each do |bucket|
|
[data_bucket, directory_bucket, auth_bucket, binary_bucket, opslog_bucket].each do |bucket|
|
||||||
bucket.keys.each {|key| bucket.delete key}
|
bucket.keys.each {|key| bucket.delete key}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user