Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add a test about env var precedence

Christophe Bliardcb3a6297e801
diff --git a/spec/constants/settings/definition_spec.rb b/spec/constants/settings/definition_spec.rb
index 190d5b11244..41a1c2ab069 100644
--- a/spec/constants/settings/definition_spec.rb
+++ b/spec/constants/settings/definition_spec.rb
@@ -93,6 +93,15 @@ RSpec.describe Settings::Definition, :settings_reset do
expect(all[:default_language].value).to eql "de"
end
+ it "picks double underscore over single underscore if both are defined in ENV",
+ with_env: {
+ "OPENPROJECT_WELCOME__TITLE" => "double underscore",
+ "OPENPROJECT_WELCOME_TITLE" => "single underscore"
+ } do
+ reset(:welcome_title)
+ expect(all[:welcome_title].value).to eql "double underscore"
+ end
+
it "allows overriding configuration from ENV without OPENPROJECT_ prefix",
with_env: { "EDITION" => "bim" } do
reset(:edition)