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"
|
2017-07-04 10:44:50 -04:00
|
|
|
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
|