mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user