Sha256: b14d66bd62e44ecfbeeb07e65d9a4bd3b763d844649f91fe11e4d45c57dfa599

Contents?: true

Size: 1.38 KB

Versions: 11

Compression:

Stored size: 1.38 KB

Contents

# Configure Rails Environment
ENV["RAILS_ENV"] = "test"

require_relative "../test/dummy/config/environment"
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__)
require "rails/test_help"

require "database_cleaner/active_record"

# # Load fixtures from the engine
# if ActiveSupport::TestCase.respond_to?(:fixture_path=)
#   ActiveSupport::TestCase.fixture_path = File.expand_path("fixtures", __dir__)
#   ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
#   ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "/files"
#   ActiveSupport::TestCase.fixtures :all
# end
require "factory_bot_rails"
Warden.test_mode!


FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), "factories")
# FactoryBot.find_definitions

DatabaseCleaner.strategy = :truncation


def init_aliyun
  raise "没有找到阿里云测试配置 在 #{Rails.root}/tmp/.debug_ak_sk_value" unless File.exist?("#{Rails.root}/tmp/.debug_ak_sk_value")

  @ak_sk_value = File.read("#{Rails.root}/tmp/.debug_ak_sk_value").split("\n")
  @ak = @ak_sk_value[0]
  @sk = @ak_sk_value[1]

  CensorBear.configure do |config|
    config.aliyun_green_access_key_id = @ak
    config.aliyun_green_access_key_secret = @sk
  end
end

require "byebug"

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
censor_bear-0.1.29 test/test_helper.rb
censor_bear-0.1.28 test/test_helper.rb
censor_bear-0.1.27 test/test_helper.rb
censor_bear-0.1.26 test/test_helper.rb
censor_bear-0.1.25 test/test_helper.rb
censor_bear-0.1.24 test/test_helper.rb
censor_bear-0.1.23 test/test_helper.rb
censor_bear-0.1.22 test/test_helper.rb
censor_bear-0.1.21 test/test_helper.rb
censor_bear-0.1.20 test/test_helper.rb
censor_bear-0.1.19 test/test_helper.rb