Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 81129ad11c932897c2003144e8a2c76a5c613878 1 parent 128d664
@sikachu sikachu authored
Showing with 8 additions and 7 deletions.
  1. +0 −4 test/storage/s3_live_test.rb
  2. +8 −3 test/storage/s3_test.rb
View
4 test/storage/s3_live_test.rb
@@ -80,8 +80,6 @@ class S3LiveTest < Test::Unit::TestCase
@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 @@ class S3LiveTest < Test::Unit::TestCase
@dummy.save
end
- teardown { @dummy.destroy }
-
should "return an unescaped version for path" do
assert_match /.+\/question\?mark\.png/, @dummy.avatar.path
end
View
11 test/storage/s3_test.rb
@@ -1,9 +1,6 @@
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 @@ def rails_env(env)
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"}
Please sign in to comment.
Something went wrong with that request. Please try again.