From 2620245552250b038da003e38c6bd1df85f4fb5c Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Tue, 10 Dec 2024 16:06:34 +0100 Subject: [PATCH] Fixes #38078 - Correctly create a DB entry for settings test In `test/unit/tasks/seeds_test.rb` the `test does not change value for existing setting` is failing because the DB setting is never created. Due to a bug in mocha (that 2.7.0 fixed) this was never uncovered. Fixes: 02dd9831bd12 ("Fixes #36395 - move value setting to seed") --- test/unit/tasks/seeds_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/tasks/seeds_test.rb b/test/unit/tasks/seeds_test.rb index 7cc880783be..7e5e3b14849 100644 --- a/test/unit/tasks/seeds_test.rb +++ b/test/unit/tasks/seeds_test.rb @@ -240,7 +240,7 @@ def seed(*seed_files) end test 'does not change value for existing setting' do - Setting[:instance_id] = Foreman.uuid + Setting.create(name: 'instance_id', value: Foreman.uuid) Setting.expects(:[]=).with(:instance_id, anything).never seed('190-instance_id.rb') end