Use the new name in default settings

This commit is contained in:
Javi Martín
2023-07-07 15:06:52 +02:00
parent 3d9a23bd1b
commit 7dfbf772e2
4 changed files with 14 additions and 12 deletions

View File

@@ -203,11 +203,11 @@ class Setting < ApplicationRecord
end end
def default_main_org_name def default_main_org_name
"CONSUL" "CONSUL DEMOCRACY"
end end
def default_mailer_from_address def default_mailer_from_address
"noreply@#{Tenant.current_host.presence || "consul.dev"}" "noreply@#{Tenant.current_host.presence || "consuldemocracy.dev"}"
end end
def reset_defaults def reset_defaults

View File

@@ -2,21 +2,21 @@ section "Creating Settings" do
Setting.reset_defaults Setting.reset_defaults
{ {
"facebook_handle": "CONSUL", "facebook_handle": "CONSUL DEMOCRACY",
"feature.featured_proposals": "true", "feature.featured_proposals": "true",
"feature.map": "true", "feature.map": "true",
"instagram_handle": "CONSUL", "instagram_handle": "CONSUL DEMOCRACY",
"meta_description": "Citizen participation tool for an open, "\ "meta_description": "Citizen participation tool for an open, "\
"transparent and democratic government", "transparent and democratic government",
"meta_keywords": "citizen participation, open government", "meta_keywords": "citizen participation, open government",
"meta_title": "CONSUL", "meta_title": "CONSUL DEMOCRACY",
"proposal_code_prefix": "MAD", "proposal_code_prefix": "MAD",
"proposal_notification_minimum_interval_in_days": 0, "proposal_notification_minimum_interval_in_days": 0,
"telegram_handle": "CONSUL", "telegram_handle": "CONSUL DEMOCRACY",
"twitter_handle": "@consul_dev", "twitter_handle": "@consuldemocracy_dev",
"twitter_hashtag": "#consul_dev", "twitter_hashtag": "#consuldemocracy_dev",
"votes_for_proposal_success": "100", "votes_for_proposal_success": "100",
"youtube_handle": "CONSUL" "youtube_handle": "CONSUL DEMOCRACY"
}.each do |name, value| }.each do |name, value|
Setting[name] = value Setting[name] = value
end end

View File

@@ -189,7 +189,7 @@ describe Setting do
describe ".default_org_name" do describe ".default_org_name" do
it "returns the main org name for the default tenant" do it "returns the main org name for the default tenant" do
expect(Setting.default_org_name).to eq "CONSUL" expect(Setting.default_org_name).to eq "CONSUL DEMOCRACY"
end end
it "returns the tenant name for other tenants" do it "returns the tenant name for other tenants" do
@@ -216,8 +216,8 @@ describe Setting do
context "empty default host" do context "empty default host" do
before { allow(Tenant).to receive(:default_host).and_return("") } before { allow(Tenant).to receive(:default_host).and_return("") }
it "uses consul.dev as host" do it "uses consuldemocracy.dev as host" do
expect(Setting.default_mailer_from_address).to eq "noreply@consul.dev" expect(Setting.default_mailer_from_address).to eq "noreply@consuldemocracy.dev"
end end
end end
end end

View File

@@ -314,6 +314,8 @@ describe "Budget Investments" do
end end
scenario "Support investments on behalf of someone else when there are more headings" do scenario "Support investments on behalf of someone else when there are more headings" do
Setting["org_name"] = "CONSUL"
create(:budget_investment, heading: heading, title: "Default heading investment") create(:budget_investment, heading: heading, title: "Default heading investment")
create(:budget_investment, heading: create(:budget_heading, group: group)) create(:budget_investment, heading: create(:budget_heading, group: group))