From 0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Tue, 31 Jul 2018 20:49:35 -0400 Subject: Prefer the ASt API --- test/test_helper.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/test_helper.rb') 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 -- cgit v1.2.3