1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/rackspace/models/storage/account_tests.rb
2013-02-15 14:26:45 -06:00

28 lines
No EOL
869 B
Ruby

Shindo.tests('Fog::Rackspace::Storage | account', ['rackspace']) do
pending if Fog.mocking?
@account = Fog::Storage[:rackspace].account
tests('load') do
headers = @account.service.head_containers.headers
returns(headers['X-Account-Meta-Temp-Url-Key']) { @account.meta_temp_url_key }
returns(headers['X-Account-Container-Count'].to_i) { @account.container_count }
returns(headers['X-Account-Bytes-Used'].to_i) { @account.bytes_used }
returns(headers['X-Account-Object-Count'].to_i) { @account.object_count }
end
tests('reload') do
@account.reload
end
tests('save') do
key = "testing-update-#{Time.now.to_i}"
@account.meta_temp_url_key = "testing-update-#{Time.now.to_i}"
@account.save
headers = @account.service.head_containers.headers
returns(key) { headers['X-Account-Meta-Temp-Url-Key'] }
end
end