2017-10-30 01:44:23 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
ENV['RAILS_ENV'] ||= 'test'
|
|
|
|
|
|
|
|
require 'active_record/railtie'
|
2018-02-06 19:56:23 +00:00
|
|
|
require 'mysql2'
|
2017-10-30 01:44:23 +00:00
|
|
|
require 'rating'
|
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
client = Mysql2::Client.new(host: '127.0.0.1', username: :root)
|
2018-02-06 19:56:23 +00:00
|
|
|
|
2018-02-06 20:05:20 +00:00
|
|
|
client.query 'DROP DATABASE IF EXISTS rating_test;'
|
|
|
|
client.query 'CREATE DATABASE IF NOT EXISTS rating_test;'
|
2018-02-06 19:56:23 +00:00
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
ActiveRecord::Base.establish_connection adapter: :mysql2, database: :rating_test, username: :root, host: '127.0.0.1'
|
2017-10-30 01:44:23 +00:00
|
|
|
|
|
|
|
Dir[File.expand_path('support/**/*.rb', __dir__)].each { |file| require file }
|