Skip to content

Commit

Permalink
Add a test about env var precedence
Browse files Browse the repository at this point in the history
OPENPROJECT_SOME__VAR takes precedence over OPENPROJECT_SOME_VAR.
  • Loading branch information
cbliard committed Oct 23, 2024
1 parent 6e9801f commit cb3a629
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/constants/settings/definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@
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)
Expand Down

0 comments on commit cb3a629

Please sign in to comment.