rails--rails/test/test_helper.rb

20 lines
710 B
Ruby
Raw Normal View History

2017-07-01 10:06:08 +00:00
require "bundler/setup"
require "active_support"
2017-07-04 16:10:53 +00:00
require "active_support/test_case"
2017-07-01 10:06:08 +00:00
require "active_support/testing/autorun"
require "byebug"
require "active_vault"
2017-07-03 19:06:09 +00:00
require "active_vault/site"
ActiveVault::Blob.site = ActiveVault::Site.configure(:Disk, root: File.join(Dir.tmpdir, "active_vault"))
2017-07-03 19:06:09 +00:00
require "active_vault/verified_key_with_expiration"
ActiveVault::VerifiedKeyWithExpiration.verifier = ActiveSupport::MessageVerifier.new("Testing")
2017-07-04 16:10:53 +00:00
class ActiveSupport::TestCase
private
def create_blob(data: "Hello world!", filename: "hello.txt", content_type: "text/plain")
ActiveVault::Blob.create_after_upload! io: StringIO.new(data), filename: filename, content_type: content_type
2017-07-04 16:10:53 +00:00
end
end