From e64e3f14fd255d91ac0aa7a272741df08da82701 Mon Sep 17 00:00:00 2001 From: Dino Maric Date: Thu, 27 Jul 2017 22:15:38 +0200 Subject: Introduce the Dummy. (#70) --- test/test_helper.rb | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'test/test_helper.rb') diff --git a/test/test_helper.rb b/test/test_helper.rb index 6c5d8f85ce..9922c8685c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,4 @@ -$LOAD_PATH << File.expand_path("../../app/controllers", __FILE__) -$LOAD_PATH << File.expand_path("../../app/models", __FILE__) -$LOAD_PATH << File.expand_path("../../app/jobs", __FILE__) +require File.expand_path("../../test/dummy/config/environment.rb", __FILE__) require "bundler/setup" require "active_support" @@ -14,7 +12,6 @@ ActiveJob::Base.logger = nil 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 @@ -23,8 +20,6 @@ rescue Errno::ENOENT {} end -require "active_storage/blob" -require "active_storage/service/disk_service" require "tmpdir" ActiveStorage::Blob.service = ActiveStorage::Service::DiskService.new(root: Dir.mktmpdir("active_storage_tests")) ActiveStorage::Service.logger = ActiveSupport::Logger.new(STDOUT) @@ -54,20 +49,6 @@ 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 - # FIXME: Hacky way to avoid having to instantiate the real engine - eval(File.readlines(File.expand_path("../../config/routes.rb", __FILE__)).slice(1..-2).join("\n")) - end - end -end - -require "active_storage/attached" -ActiveRecord::Base.send :extend, ActiveStorage::Attached::Macros - require "global_id" GlobalID.app = "ActiveStorageExampleApp" ActiveRecord::Base.send :include, GlobalID::Identification -- cgit v1.2.3