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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user