mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|storage] Override path when generating sha1 to make tests past
This commit is contained in:
parent
4f29f79e9d
commit
ca8a23426d
1 changed files with 15 additions and 3 deletions
|
@ -4,6 +4,12 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', [:rackspace]) do
|
|||
@directory = Fog::Storage[:rackspace].directories.create(:key => 'fogobjecttests')
|
||||
end
|
||||
|
||||
module RackspaceStorageHelpers
|
||||
def override_path(path)
|
||||
@path = path
|
||||
end
|
||||
end
|
||||
|
||||
tests('success') do
|
||||
|
||||
tests("#put_object('fogobjecttests', 'fog_object')").succeeds do
|
||||
|
@ -40,8 +46,10 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', [:rackspace]) do
|
|||
pending if Fog.mocking?
|
||||
expires_at = 1344149532 # 2012-08-05 16:52:12 +1000
|
||||
storage = Fog::Storage::Rackspace.new(:rackspace_temp_url_key => "super_secret")
|
||||
storage.extend RackspaceStorageHelpers
|
||||
storage.override_path('/fake_version/fake_tenant')
|
||||
object_url = storage.get_object_https_url('fogobjecttests', 'fog_object', expires_at)
|
||||
object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog_object\?temp_url_sig=8abd27f8345b6f3c5fceb9ef71d8ac59ffb15500&temp_url_expires=1344149532/
|
||||
object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog_object\?temp_url_sig=7e69a73092e333095a70b3be826a7350fcbede86&temp_url_expires=1344149532/
|
||||
end
|
||||
|
||||
# an object key nested under a /
|
||||
|
@ -49,8 +57,10 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', [:rackspace]) do
|
|||
pending if Fog.mocking?
|
||||
expires_at = 1344149532 # 2012-08-05 16:52:12 +1000
|
||||
storage = Fog::Storage::Rackspace.new(:rackspace_temp_url_key => "super_secret")
|
||||
storage.extend RackspaceStorageHelpers
|
||||
storage.override_path('/fake_version/fake_tenant')
|
||||
object_url = storage.get_object_https_url('fogobjecttests', 'fog/object', expires_at)
|
||||
object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog\/object\?temp_url_sig=1dc1de4544f75cf9eba85bde500059472c94adcd&temp_url_expires=1344149532/
|
||||
object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog\/object\?temp_url_sig=3e99892828804e3d0fdadd18c543b688591ca8b8&temp_url_expires=1344149532/
|
||||
end
|
||||
|
||||
# an object key containing a -
|
||||
|
@ -58,8 +68,10 @@ Shindo.tests('Fog::Storage[:rackspace] | object requests', [:rackspace]) do
|
|||
pending if Fog.mocking?
|
||||
expires_at = 1344149532 # 2012-08-05 16:52:12 +1000
|
||||
storage = Fog::Storage::Rackspace.new(:rackspace_temp_url_key => "super_secret")
|
||||
storage.extend RackspaceStorageHelpers
|
||||
storage.override_path('/fake_version/fake_tenant')
|
||||
object_url = storage.get_object_https_url('fogobjecttests', 'fog-object', expires_at)
|
||||
object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog%2Dobject\?temp_url_sig=f664ec159300d91b2cb735249c630645b55b87a1&temp_url_expires=1344149532/
|
||||
object_url =~ /https:\/\/.*clouddrive.com\/[^\/]+\/[^\/]+\/fogobjecttests\/fog%2Dobject\?temp_url_sig=a24dd5fc955a57adce7d1b5bc4ec2c7660ab8396&temp_url_expires=1344149532/
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue