From e86748edca76facbfa18e001758ca85d936da4e9 Mon Sep 17 00:00:00 2001 From: Riccardo Graziosi <31478034+riggraz@users.noreply.github.com> Date: Sat, 3 Dec 2022 19:04:06 +0100 Subject: [PATCH] Fix specs (#175) --- spec/spec_helper.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b2e6a9dd..5f35adac 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,14 +14,12 @@ # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| - # Reset Current instance and delete all tenants from test db - # Create a new default tenant and set Current.tenant + ENV["RAILS_ENV"] = "test" + + # Set tenant before each test config.before(:all) do - Current.reset - Tenant.delete_all - - tenant = FactoryBot.create(:tenant) - Current.tenant = tenant + # Current.reset + Current.tenant = Tenant.first_or_create(site_name: 'test', subdomain: 'test') end # rspec-expectations config goes here. You can use an alternate