aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-04 18:10:53 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-04 18:10:53 +0200
commit09878fb19d46674605fb6e48c1b86e2915ad7496 (patch)
tree1588de8214f396829d8790676f97cfce30eb281a /test/test_helper.rb
parenta39295d85b5f0cb326069af163c71651b0ca5b3e (diff)
downloadrails-09878fb19d46674605fb6e48c1b86e2915ad7496.tar.gz
rails-09878fb19d46674605fb6e48c1b86e2915ad7496.tar.bz2
rails-09878fb19d46674605fb6e48c1b86e2915ad7496.zip
Extract create_blob test helper
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 1f947fce90..9bb4a2fca1 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,5 +1,6 @@
require "bundler/setup"
require "active_support"
+require "active_support/test_case"
require "active_support/testing/autorun"
require "byebug"
@@ -10,3 +11,10 @@ ActiveFile::Blob.site = ActiveFile::Site.configure(:Disk, root: File.join(Dir.tm
require "active_file/verified_key_with_expiration"
ActiveFile::VerifiedKeyWithExpiration.verifier = ActiveSupport::MessageVerifier.new("Testing")
+
+class ActiveSupport::TestCase
+ private
+ def create_blob(data: "Hello world!", filename: "hello.txt", content_type: "text/plain")
+ ActiveFile::Blob.create_after_upload! io: StringIO.new(data), filename: filename, content_type: content_type
+ end
+end \ No newline at end of file