This commit is contained in:
Anthony Davis 2014-01-07 16:32:16 -06:00
parent 25f4d9b449
commit a7be00c8f9
1 changed files with 4 additions and 25 deletions

View File

@ -29,39 +29,18 @@ def cookie_jar
Capybara.current_session.driver.browser.current_session.instance_variable_get(:@rack_mock_session).cookie_jar
end
#these S3 functions copied from ruby/spec/support/utilities.rb
JAMKAZAM_TESTING_BUCKET = 'jamkazam-testing' # cuz i'm not comfortable using aws_bucket accessor directly
def app_config
klass = Class.new do
def aws_bucket
JAMKAZAM_TESTING_BUCKET
end
def aws_access_key_id
'AKIAJESQY24TOT542UHQ'
end
def aws_secret_access_key
'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'
end
end
return klass.new
end
#see also ruby/spec/support/utilities.rb
JAMKAZAM_TESTING_BUCKET = 'jamkazam-testing' #at least, this is the name given in jam-ruby
def wipe_s3_test_bucket
test_config = app_config
s3 = AWS::S3.new(:access_key_id => test_config.aws_access_key_id,
:secret_access_key => test_config.aws_secret_access_key)
s3 = AWS::S3.new(:access_key_id => Rails.application.config.aws_access_key_id,
:secret_access_key => Rails.application.config.aws_secret_access_key)
test_bucket = s3.buckets[JAMKAZAM_TESTING_BUCKET]
if test_bucket.name == JAMKAZAM_TESTING_BUCKET
puts "Web - Pretending to delete all contents of #{test_bucket.name}"
#test_bucket.delete_all
end
end
# --end of S3 methods copied from ruby/spec/support/utilities.rb
def sign_in(user)