diff --git a/test/fixtures/history_values.yml b/test/fixtures/history_values.yml index eadf4f7ba..4ce437af6 100644 --- a/test/fixtures/history_values.yml +++ b/test/fixtures/history_values.yml @@ -843,3 +843,12 @@ history_value_99: created_at: '2022-12-20 14:38:40.000421' updated_at: '2022-12-20 14:38:40.000421' invoicing_profile_id: 1 + +history_value_100: + id: 100 + setting_id: 99 + value: 'background-color: white;' + created_at: 2023-04-05 09:16:08.000511500 Z + updated_at: 2023-04-05 09:16:08.000511500 Z + invoicing_profile_id: 1 + diff --git a/test/fixtures/settings.yml b/test/fixtures/settings.yml index 31731e54c..eb21fa7f8 100644 --- a/test/fixtures/settings.yml +++ b/test/fixtures/settings.yml @@ -580,3 +580,9 @@ setting_98: name: machines_module created_at: 2020-04-15 14:38:40.000421500 Z updated_at: 2020-04-15 14:38:40.000421500 Z + +setting_99: + id: 99 + name: home_css + created_at: 2023-04-05 09:16:08.000511500 Z + updated_at: 2023-04-05 09:16:08.000511500 Z diff --git a/test/integration/settings_test.rb b/test/integration/settings_test.rb index 151bfa38c..35c6b9146 100644 --- a/test/integration/settings_test.rb +++ b/test/integration/settings_test.rb @@ -49,6 +49,9 @@ class SettingsTest < ActionDispatch::IntegrationTest end test 'transactional bulk update fails' do + old_css = Setting.get('home_css') + old_color = Setting.get('main_color') + patch '/api/settings/bulk_update?transactional=true', params: { settings: [ @@ -61,6 +64,10 @@ class SettingsTest < ActionDispatch::IntegrationTest resp = json_response(response.body) assert_not_nil resp[:settings].first[:error] assert_match(/Error: Invalid CSS after/, resp[:settings].first[:error].first) + + # Check values havn't changed + assert_equal old_css, Setting.get('home_css') + assert_equal old_color, Setting.get('main_color') end test 'update setting with wrong name' do