From 79586640683a2c9b1a1504562c49f5ac674598d2 Mon Sep 17 00:00:00 2001 From: Washington Botelho Date: Tue, 6 Feb 2018 18:05:20 -0200 Subject: [PATCH] fix: drop if table exists --- spec/rails_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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