Fix DemoFamilyRefreshJob demo email config lookup (#1426)

* Fix demo refresh email config lookup

Use indifferent access when reading demo config so the refresh job works whether config keys are strings or symbols. Add a regression test covering symbol-keyed config_for output.

* Remove unnecessary blank line in test file

Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>

---------

Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
Juan José Mata
2026-04-10 17:42:51 +02:00
committed by GitHub
parent dcebda05de
commit 65c5f8eb07
2 changed files with 11 additions and 1 deletions

View File

@@ -61,4 +61,14 @@ class DemoFamilyRefreshJobTest < ActiveJob::TestCase
assert_match(/\+deleting-/, @demo_user.email)
end
end
test "reads demo email when config_for returns symbol keys" do
Rails.application.stubs(:config_for).with(:demo).returns({ email: @demo_email })
generator = mock
generator.expects(:generate_default_data!).with(skip_clear: true, email: @demo_email)
Demo::Generator.expects(:new).returns(generator)
DemoFamilyRefreshJob.perform_now
end
end