Commit 9ef9b512 by Isaac Betesh Committed by Jon Yurek

Proof-of-concept for making specs run with Aws v2

parent c6dce205
...@@ -3,17 +3,18 @@ require 'aws-sdk' ...@@ -3,17 +3,18 @@ require 'aws-sdk'
describe Paperclip::Storage::S3 do describe Paperclip::Storage::S3 do
before do before do
AWS.stub! AWS.stub! unless defined?(::Aws)
end end
let(:client) { Aws::S3::Client.new(stub_responses: true) }
context "Parsing S3 credentials" do context "Parsing S3 credentials" do
before do before do
@proxy_settings = {host: "127.0.0.1", port: 8888, user: "foo", password: "bar"} @proxy_settings = {host: "127.0.0.1", port: 8888, user: "foo", password: "bar"}
rebuild_model storage: :s3, rebuild_model (defined?(::Aws) ? { client: client } : {}).merge storage: :s3,
bucket: "testing", bucket: "testing",
http_proxy: @proxy_settings, http_proxy: @proxy_settings,
s3_credentials: {not: :important} s3_credentials: {not: :important}
@dummy = Dummy.new @dummy = Dummy.new
@avatar = @dummy.avatar @avatar = @dummy.avatar
end end
......
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