From b111aedbce21635dc34fcb79a87f4bfc547320e9 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Fri, 29 Jun 2012 12:38:25 +0200 Subject: [PATCH] Use proper signature when testing with aws mock --- tests/aws/models/storage/url_tests.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/aws/models/storage/url_tests.rb b/tests/aws/models/storage/url_tests.rb index 16a1cb99a..c0c45f431 100644 --- a/tests/aws/models/storage/url_tests.rb +++ b/tests/aws/models/storage/url_tests.rb @@ -13,8 +13,14 @@ Shindo.tests('AWS | url') do @file = @storage.directories.new(key: 'fognonbucket').files.new(key: 'test.txt') + if Fog.mock? + signature = Fog::Storage::AWS.new.signature(nil) + else + signature = 'tajHIhKHAdFYsigmzybCpaq8N0Q%3D' + end + tests('#url w/ response-cache-control').returns( - 'https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&AWSAccessKeyId=123&Signature=tajHIhKHAdFYsigmzybCpaq8N0Q%3D&Expires=1356998400' + "https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&AWSAccessKeyId=123&Signature=#{signature}&Expires=1356998400" ) do @file.url(@expires, query: { 'response-cache-control' => 'No-cache' }) end