mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[storage] more helpful naming of attributes in tests
This commit is contained in:
parent
15832b0eb7
commit
969300ed01
4 changed files with 21 additions and 13 deletions
|
@ -2,11 +2,11 @@ for provider, config in storage_providers
|
|||
|
||||
Shindo.tests("#{provider}::Storage | directories", [provider.to_s.downcase]) do
|
||||
|
||||
attributes = {
|
||||
directory_attributes = {
|
||||
:key => 'fogdirectoriestests',
|
||||
}.merge!(config[:directories_attributes] || {})
|
||||
}.merge!(config[:directory_attributes] || {})
|
||||
|
||||
collection_tests(provider[:storage].directories, attributes, config[:mocked])
|
||||
collection_tests(provider[:storage].directories, directory_attributes, config[:mocked])
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ for provider, config in storage_providers
|
|||
|
||||
Shindo.tests("#{provider}::Storage | directory", [provider.to_s.downcase]) do
|
||||
|
||||
attributes = {
|
||||
directory_attributes = {
|
||||
:key => 'fogdirectorytests'
|
||||
}.merge!(config[:directory_attributes] || {})
|
||||
|
||||
model_tests(provider[:storage].directory, attributes, config[:mocked]) do
|
||||
model_tests(provider[:storage].directory, directory_attributes, config[:mocked]) do
|
||||
|
||||
tests("#public=(true)").succeeds do
|
||||
pending if Fog.mocking? && !config[:mocked]
|
||||
|
|
|
@ -2,17 +2,21 @@ for provider, config in storage_providers
|
|||
|
||||
Shindo.tests("#{provider}::Storage | file", [provider.to_s.downcase]) do
|
||||
|
||||
attributes = {
|
||||
file_attributes = {
|
||||
:key => 'fog_file_tests',
|
||||
:body => lorem_file,
|
||||
:public => true
|
||||
}.merge!(config[:directory_attributes] || {})
|
||||
}.merge!(config[:file_attributes] || {})
|
||||
|
||||
if !Fog.mocking? || config[:mocked]
|
||||
|
||||
@directory = provider[:storage].directories.create(:key => 'fogfilestests')
|
||||
directory_attributes = {
|
||||
:key => 'fogfilestests'
|
||||
}.merge!(config[:directory_attributes] || {})
|
||||
|
||||
model_tests(@directory.files, attributes, config[:mocked]) do
|
||||
@directory = provider[:storage].directories.create(directory_attributes)
|
||||
|
||||
model_tests(@directory.files, file_attributes, config[:mocked]) do
|
||||
|
||||
responds_to(:public_url)
|
||||
|
||||
|
|
|
@ -2,16 +2,20 @@ for provider, config in storage_providers
|
|||
|
||||
Shindo.tests("#{provider}::Storage | files", [provider.to_s.downcase]) do
|
||||
|
||||
attributes = {
|
||||
file_attributes = {
|
||||
:key => 'fog_files_tests',
|
||||
:body => lorem_file
|
||||
}.merge!(config[:files_attributes] || {})
|
||||
}.merge!(config[:file_attributes] || {})
|
||||
|
||||
if !Fog.mocking? || config[:mocked]
|
||||
|
||||
@directory = provider.directories.create(:key => 'fogfilestests')
|
||||
directory_attributes = {
|
||||
:key => 'fogfilestests'
|
||||
}.merge!(config[:directory_attributes] || {})
|
||||
|
||||
collection_tests(@directory.files, attributes, config[:mocked])
|
||||
@directory = provider.directories.create(directory_attributes)
|
||||
|
||||
collection_tests(@directory.files, file_attributes, config[:mocked])
|
||||
|
||||
@directory.destroy
|
||||
|
||||
|
|
Loading…
Reference in a new issue