diff --git a/test/integration/events/as_user_test.rb b/test/integration/events/as_user_test.rb index 7c39535a5..97f5a33a4 100644 --- a/test/integration/events/as_user_test.rb +++ b/test/integration/events/as_user_test.rb @@ -19,13 +19,8 @@ class Events::AsUserTest < ActionDispatch::IntegrationTest wallet_transactions_count = WalletTransaction.count # Enable the VAT at 19.6% - vat_active = Setting.get('invoice_VAT-active') - vat_active.value = 'true' - vat_active.save! - - vat_rate = Setting.get('invoice_VAT-rate') - vat_rate.value = '19.6' - vat_rate.save! + Setting.set('invoice_VAT-active', true) + Setting.set('invoice_VAT-rate', '19.6') # Reserve the 'radio' event VCR.use_cassette('reserve_event_with_many_prices_and_payment_means') do diff --git a/test/integration/settings_test.rb b/test/integration/settings_test.rb index 9dfe44ddc..03decf6fa 100644 --- a/test/integration/settings_test.rb +++ b/test/integration/settings_test.rb @@ -22,7 +22,7 @@ class SettingsTest < ActionDispatch::IntegrationTest assert_equal 'Test Fablab', resp[:setting][:value] # Check record - setting = Setting.get(resp[:setting][:name]) + setting = Setting.find_by(name: resp[:setting][:name]) assert_not_nil setting, 'setting was not found in database' assert_equal 2, setting.history_values.count, 'all historical values were not found' assert_includes setting.history_values.map(&:value), 'Fab Lab de La Casemate', 'previous parameter was not saved'