diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-09 18:03:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-09 18:03:13 +0200 |
commit | a19d943f1de7d856d74ff8a0e1806da99be26076 (patch) | |
tree | 8b4cc691b003f060d72702f88f52efde129b0c20 /test/test_helper.rb | |
parent | b1cf901d282c869c670fa4246be5ce40116112c9 (diff) | |
download | rails-a19d943f1de7d856d74ff8a0e1806da99be26076.tar.gz rails-a19d943f1de7d856d74ff8a0e1806da99be26076.tar.bz2 rails-a19d943f1de7d856d74ff8a0e1806da99be26076.zip |
Direct uploads for S3
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index b67296a659..ca1e0cad7e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,6 +5,17 @@ require "active_support/testing/autorun" require "byebug" require "active_storage" + +require "active_storage/service" +require "yaml" +SERVICE_CONFIGURATIONS = begin + YAML.load_file(File.expand_path("../service/configurations.yml", __FILE__)).deep_symbolize_keys +rescue Errno::ENOENT + puts "Missing service configuration file in test/service/configurations.yml" + {} +end + + require "active_storage/service/disk_service" ActiveStorage::Blob.service = ActiveStorage::Service::DiskService.new(root: File.join(Dir.tmpdir, "active_storage")) ActiveStorage::Service.logger = ActiveSupport::Logger.new(STDOUT) @@ -19,6 +30,16 @@ class ActiveSupport::TestCase end end +require "action_controller" +require "action_controller/test_case" + +class ActionController::TestCase + Routes = ActionDispatch::Routing::RouteSet.new.tap do |routes| + routes.draw do + eval(File.read(File.expand_path("../../lib/active_storage/routes.rb", __FILE__))) + end + end +end require "active_storage/attached" ActiveRecord::Base.send :extend, ActiveStorage::Attached::Macros @@ -26,3 +47,4 @@ ActiveRecord::Base.send :extend, ActiveStorage::Attached::Macros require "global_id" GlobalID.app = "ActiveStorageExampleApp" ActiveRecord::Base.send :include, GlobalID::Identification +SignedGlobalID.verifier = ActiveStorage::VerifiedKeyWithExpiration.verifier
\ No newline at end of file |