Use the tenant name as default organization name

This way we'll avoid having all tenant organizations named "CONSUL" by
default, and we'll also use different email senders per tenant, which
will reduce the change of the emails being marked as spam.
This commit is contained in:
Javi Martín
2022-11-10 00:37:45 +01:00
parent 03614325d1
commit 061ae94f98
4 changed files with 28 additions and 5 deletions

View File

@@ -187,6 +187,20 @@ describe Setting do
end
end
describe ".default_org_name" do
it "returns the main org name for the default tenant" do
expect(Setting.default_org_name).to eq "CONSUL"
end
it "returns the tenant name for other tenants" do
create(:tenant, schema: "new", name: "New Institution")
Tenant.switch("new") do
expect(Setting.default_org_name).to eq "New Institution"
end
end
end
describe ".default_mailer_from_address" do
before { allow(Tenant).to receive(:default_host).and_return("consulproject.org") }