mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 03:07:52 +01:00
Fix specs (#175)
This commit is contained in:
committed by
GitHub
parent
956393ce24
commit
e86748edca
@@ -14,14 +14,12 @@
|
|||||||
#
|
#
|
||||||
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
# Reset Current instance and delete all tenants from test db
|
ENV["RAILS_ENV"] = "test"
|
||||||
# Create a new default tenant and set Current.tenant
|
|
||||||
config.before(:all) do
|
|
||||||
Current.reset
|
|
||||||
Tenant.delete_all
|
|
||||||
|
|
||||||
tenant = FactoryBot.create(:tenant)
|
# Set tenant before each test
|
||||||
Current.tenant = tenant
|
config.before(:all) do
|
||||||
|
# Current.reset
|
||||||
|
Current.tenant = Tenant.first_or_create(site_name: 'test', subdomain: 'test')
|
||||||
end
|
end
|
||||||
|
|
||||||
# rspec-expectations config goes here. You can use an alternate
|
# rspec-expectations config goes here. You can use an alternate
|
||||||
|
|||||||
Reference in New Issue
Block a user