Commit 544fa14c by Isaac Betesh Committed by Tute Costa

S3 specs fixes

* correct S3 specs to use the correct keys in the s3_credentials hash
* S3 tests work with a region that requires s3_domain_url

[fixes #1985]
parent 5202acbf
......@@ -10,8 +10,8 @@ unless ENV["S3_BUCKET"].blank?
path: ":class/:attachment/:id/:style.:extension",
s3_region: ENV["S3_REGION"],
s3_credentials: {
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
aws_secre_access_key: ENV['AWS_SECRET_ACCESS_KEY']
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
}
@file = File.new(fixture_file("5k.png"))
......@@ -48,8 +48,8 @@ unless ENV["S3_BUCKET"].blank?
path: ":class/:attachment/:id/:style.:extension",
s3_region: ENV["S3_REGION"],
s3_credentials: {
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
aws_secre_access_key: ENV['AWS_SECRET_ACCESS_KEY']
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
}
@dummy = Dummy.new
......@@ -68,8 +68,8 @@ unless ENV["S3_BUCKET"].blank?
path: ":class/:attachment/:id/:style.:extension",
s3_region: ENV["S3_REGION"],
s3_credentials: {
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
aws_secre_access_key: ENV['AWS_SECRET_ACCESS_KEY']
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
}
Dummy.delete_all
......@@ -109,9 +109,11 @@ unless ENV["S3_BUCKET"].blank?
storage: :s3,
bucket: ENV["S3_BUCKET"],
s3_region: ENV["S3_REGION"],
url: ":s3_domain_url",
path: "/:class/:attachment/:id_partition/:style/:filename",
s3_credentials: {
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
aws_secre_access_key: ENV['AWS_SECRET_ACCESS_KEY']
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
}
Dummy.delete_all
......@@ -152,8 +154,8 @@ unless ENV["S3_BUCKET"].blank?
path: ":class/:attachment/:id/:style.:extension",
s3_region: ENV["S3_REGION"],
s3_credentials: {
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
aws_secre_access_key: ENV['AWS_SECRET_ACCESS_KEY']
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
},
s3_server_side_encryption: "AES256"
Dummy.delete_all
......
......@@ -48,13 +48,16 @@ module Assertions
end
def assert_success_response(url)
url = "http:#{url}" unless url =~ /http/
Net::HTTP.get_response(URI.parse(url)) do |response|
assert_equal "200", response.code,
assert_equal "200",
response.code,
"Expected HTTP response code 200, got #{response.code}"
end
end
def assert_not_found_response(url)
url = "http:#{url}" unless url =~ /http/
Net::HTTP.get_response(URI.parse(url)) do |response|
assert_equal "404", response.code,
"Expected HTTP response code 404, got #{response.code}"
......@@ -62,6 +65,7 @@ module Assertions
end
def assert_forbidden_response(url)
url = "http:#{url}" unless url =~ /http/
Net::HTTP.get_response(URI.parse(url)) do |response|
assert_equal "403", response.code,
"Expected HTTP response code 403, got #{response.code}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment