Move subdomain logic to tenant model

We had some of the logic in the ApplicationMailer. Since we're going to
use this logic in more places, we're moving it to the Tenant model,
which is the model handling everything related to hosts.
This commit is contained in:
Javi Martín
2022-10-05 23:37:51 +02:00
parent 468761253b
commit d904fe8b4f
4 changed files with 24 additions and 24 deletions

View File

@@ -74,7 +74,7 @@ describe "rake sitemap:create", type: :system do
end
it "generates a sitemap for every tenant" do
allow(ActionMailer::Base).to receive(:default_url_options).and_return({ host: "consul.dev" })
allow(Tenant).to receive(:default_url_options).and_return({ host: "consul.dev" })
FileUtils.rm_f(Dir.glob(Rails.root.join("public", "tenants", "*", "sitemap.xml")))
create(:tenant, schema: "debates")