Commit 81129ad1 by Prem Sichanugrist

Do not calling `AWS.stub!` right away, it's leaking to S3LiveTest

parent 128d664c
......@@ -80,8 +80,6 @@ unless ENV["S3_BUCKET"].blank?
@dummy.save
end
teardown { @dummy.destroy }
should "return an unescaped version for path" do
assert_match /.+\/spaced file\.png/, @dummy.avatar.path
end
......@@ -114,8 +112,6 @@ unless ENV["S3_BUCKET"].blank?
@dummy.save
end
teardown { @dummy.destroy }
should "return an unescaped version for path" do
assert_match /.+\/question\?mark\.png/, @dummy.avatar.path
end
......
require './test/helper'
require 'aws'
AWS.stub!
AWS.config(:access_key_id => "TESTKEY", :secret_access_key => "TESTSECRET")
class S3Test < Test::Unit::TestCase
def rails_env(env)
silence_warnings do
......@@ -11,6 +8,14 @@ class S3Test < Test::Unit::TestCase
end
end
def setup
AWS.config(:access_key_id => "TESTKEY", :secret_access_key => "TESTSECRET", :stub_requests => true)
end
def teardown
AWS.config(:access_key_id => nil, :secret_access_key => nil, :stub_requests => nil)
end
context "Parsing S3 credentials" do
setup do
@proxy_settings = {:host => "127.0.0.1", :port => 8888, :user => "foo", :password => "bar"}
......
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