1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/hp/models/storage/files_tests.rb

38 lines
930 B
Ruby
Raw Normal View History

Shindo.tests("Fog::Storage[:hp] | files", ['hp', 'storage']) do
2012-10-02 01:16:26 -04:00
file_attributes = {
:key => 'fog_files_tests',
:body => lorem_file
}
directory_attributes = {
:key => 'fogfilestests'
}
collection_tests(Fog::Storage[:hp].directories.create(directory_attributes).files, file_attributes, true)
2012-10-02 01:16:26 -04:00
@directory = Fog::Storage[:hp].directories.create(directory_attributes)
@file = @directory.files.create(file_attributes)
2012-10-02 01:16:26 -04:00
tests('success') do
2012-10-02 01:16:26 -04:00
tests("#get_url('#{@directory.key}')").succeeds do
@directory.files.get_url(@directory.key)
end
2012-10-02 01:16:26 -04:00
tests("#get_cdn_url('#{@directory.key}')").succeeds do
pending if Fog.mocking?
@directory.files.get_cdn_url(@directory.key)
end
2012-10-02 01:16:26 -04:00
tests("#get_cdn_ssl_url('#{@directory.key}')").succeeds do
pending if Fog.mocking?
@directory.files.get_cdn_ssl_url(@directory.key)
2012-10-02 01:16:26 -04:00
end
end
@file.destroy
2012-10-02 01:16:26 -04:00
@directory.destroy
end