1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

corrects object_tests, also working in mock mode now

This commit is contained in:
Julian Weber 2013-10-16 14:25:31 +02:00
parent 71d8953a62
commit f1a2d1d141

View file

@ -49,14 +49,20 @@ Shindo.tests("Fog::Storage[:hp] | object requests", ['hp', 'storage']) do
tests("#get_object_http_url('#{@directory.identity}', 'fog_object', expiration timestamp)").returns(true) do
object_url = Fog::Storage[:hp].get_object_http_url(@dir_name, 'fog_object', (Time.now + 60))
(object_url =~ /http:\/\/\S+\/v1\/AUTH_\S+\/#{@dir_name}\/fog_object\?temp_url_sig=\S+&temp_url_expires=\d+/) != nil
object_url.include? "fog_object"
object_url.include? "&temp_url_expires="
object_url.include? "temp_url_sig="
object_url.include? @dir_name
object_url.start_with? "http://"
end
tests("#get_object_https_url('#{@directory.identity}', 'fog_object', expiration timestamp)").returns(true) do
object_url = Fog::Storage[:hp].get_object_https_url(@dir_name, 'fog_object', (Time.now + 60))
(object_url =~ /https:\/\/\S+\/v1\/AUTH_\S+\/#{@dir_name}\/fog_object\?temp_url_sig=\S+&temp_url_expires=\d+/) != nil
object_url.include? "fog_object"
object_url.include? "&temp_url_expires="
object_url.include? "temp_url_sig="
object_url.include? @dir_name
object_url.start_with? "https://"
end
end