DEV: Use a tmp directory for storing uploads in tests (#9554)

This avoids development-mode upload files from polluting the test environment
This commit is contained in:
David Taylor
2020-04-28 14:03:04 +01:00
committed by GitHub
parent 7177b9d771
commit ba616ffb50
4 changed files with 7 additions and 11 deletions

View File

@ -248,8 +248,8 @@ class S3Helper
def multisite_upload_path
path = File.join("uploads", RailsMultisite::ConnectionManagement.current_db, "/")
return path unless Discourse.is_parallel_test?
File.join(path, ENV['TEST_ENV_NUMBER'].presence || '1', "/")
return path if !Rails.env.test?
File.join(path, "test_#{ENV['TEST_ENV_NUMBER'].presence || '0'}", "/")
end
def s3_resource