diff options
author | George Claghorn <george@basecamp.com> | 2018-07-31 20:49:35 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-07-31 20:49:35 -0400 |
commit | 0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b (patch) | |
tree | ac5a99fd643c17f0e100496321a4b4c404e5bb11 /test/test_helper.rb | |
parent | 36b69850cc6cafa60230ca92eabb9ad93adf7e81 (diff) | |
download | rails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.tar.gz rails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.tar.bz2 rails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.zip |
Prefer the ASt API
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index 94fec6b8be..79fde51549 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -19,3 +19,10 @@ if ActiveSupport::TestCase.respond_to?(:fixture_path=) ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "/files" ActiveSupport::TestCase.fixtures :all end + +class ActiveSupport::TestCase + private + def create_file_blob(filename:, content_type:, metadata: nil) + ActiveStorage::Blob.create_after_upload! io: file_fixture(filename).open, filename: filename, content_type: content_type, metadata: metadata + end +end |