Only seed tenants when necessary in tests

On my machine, seeding a tenant takes about one second, so skipping this
action when it isn't necessary makes tests creating tenants faster
(although creating a tenant still takes about 3-4 seconds on my
machine).
This commit is contained in:
Javi Martín
2022-10-13 03:07:28 +02:00
parent 0ea61b9b61
commit 58c9e8462d
5 changed files with 14 additions and 3 deletions

View File

@@ -80,15 +80,18 @@ describe "rake sitemap:create", type: :system do
create(:tenant, schema: "debates")
create(:tenant, schema: "proposals")
Setting["process.budgets"] = true
Setting["process.debates"] = false
Setting["process.proposals"] = false
Tenant.switch("debates") do
Setting["process.debates"] = true
Setting["process.budgets"] = false
Setting["process.proposals"] = false
end
Tenant.switch("proposals") do
Setting["process.proposals"] = true
Setting["process.budgets"] = false
Setting["process.debates"] = false
end