Sha256: f6d2c652951a2ba1c152cccaae631ca2a66377ae465fc5507d58d1f3f5925e59

Contents?: true

Size: 870 Bytes

Versions: 1

Compression:

Stored size: 870 Bytes

Contents

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)+'./../lib/acts_as_textcaptcha'))

ENV['RAILS_ENV'] = 'test'

# ensure tmp dir exists
FileUtils.mkdir_p './tmp'

require 'minitest/autorun'
require 'webmock/minitest'
require 'rails/all'
require 'acts_as_textcaptcha'
require './test/test_models'

# load and initialize test db schema
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => 'tmp/acts_as_textcaptcha_test.sqlite3.db')
load(File.dirname(__FILE__) + "/schema.rb")

# initialize the Rails cache (use a basic memory store in tests)
if Rails.version >= '4'
  Rails.cache = ActiveSupport::Cache::MemoryStore.new
else
  RAILS_CACHE = ActiveSupport::Cache::MemoryStore.new
end

# additional helper methods for use in tests
def find_in_cache(key)
  Rails.cache.read("#{ActsAsTextcaptcha::TextcaptchaCache::CACHE_KEY_PREFIX}#{key}")
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts_as_textcaptcha-4.3.0 test/test_helper.rb