diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index e3546f6..0aeabc0 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -9,8 +9,8 @@ require 'rating' client = Mysql2::Client.new(host: :localhost, username: :root) -client.query 'DROP DATABASE rating_test;' -client.query 'CREATE DATABASE rating_test;' +client.query 'DROP DATABASE IF EXISTS rating_test;' +client.query 'CREATE DATABASE IF NOT EXISTS rating_test;' ActiveRecord::Base.establish_connection adapter: :mysql2, database: :rating_test, username: :root