1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/test/test_helper.rb

20 lines
702 B
Ruby
Raw Normal View History

2017-07-01 06:06:08 -04:00
require "bundler/setup"
require "active_support"
2017-07-04 12:10:53 -04:00
require "active_support/test_case"
2017-07-01 06:06:08 -04:00
require "active_support/testing/autorun"
require "byebug"
require "active_file"
2017-07-03 15:06:09 -04:00
require "active_file/site"
ActiveFile::Blob.site = ActiveFile::Site.configure(:Disk, root: File.join(Dir.tmpdir, "active_file"))
2017-07-03 15:06:09 -04:00
require "active_file/verified_key_with_expiration"
ActiveFile::VerifiedKeyWithExpiration.verifier = ActiveSupport::MessageVerifier.new("Testing")
2017-07-04 12:10:53 -04:00
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