aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
blob: 9bb4a2fca1fbef1c2aaf90e3379ca6a517e44abb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "bundler/setup"
require "active_support"
require "active_support/test_case"
require "active_support/testing/autorun"
require "byebug"

require "active_file"

require "active_file/site"
ActiveFile::Blob.site = ActiveFile::Site.configure(:Disk, root: File.join(Dir.tmpdir, "active_file"))

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