From a679c713a8f5d245efca32befb23e3da112797fe Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 20 Feb 2019 18:09:03 +0100 Subject: [PATCH] Maintenance: Gem dependency psych update causes encoding issue to be fixed. Changed test case to ensure special unicode chars are handled properly. --- db/migrate/20180911064647_issue_2140_reset_ldap_config.rb | 3 +++ spec/db/migrate/issue_2140_reset_ldap_config_spec.rb | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/db/migrate/20180911064647_issue_2140_reset_ldap_config.rb b/db/migrate/20180911064647_issue_2140_reset_ldap_config.rb index 4a2a94f20..dbc3643ae 100644 --- a/db/migrate/20180911064647_issue_2140_reset_ldap_config.rb +++ b/db/migrate/20180911064647_issue_2140_reset_ldap_config.rb @@ -1,3 +1,6 @@ +# ATTENTION: This migration is most likely not required anymore +# because the encoding error was fixed by using a newer version of the psych gem (3.1.0). +# However, we'll keep it as a regression test. class Issue2140ResetLdapConfig < ActiveRecord::Migration[5.1] def up # return if it's a new setup diff --git a/spec/db/migrate/issue_2140_reset_ldap_config_spec.rb b/spec/db/migrate/issue_2140_reset_ldap_config_spec.rb index 1b4bc125b..22507082e 100644 --- a/spec/db/migrate/issue_2140_reset_ldap_config_spec.rb +++ b/spec/db/migrate/issue_2140_reset_ldap_config_spec.rb @@ -17,7 +17,7 @@ RSpec.describe Issue2140ResetLdapConfig, type: :db_migration do end end - context 'when LDAP config is broken' do + context 'when LDAP config was assumed to be broken' do let(:config) do { 'wizardData' => { 'backend_user_attributes' => @@ -26,10 +26,8 @@ RSpec.describe Issue2140ResetLdapConfig, type: :db_migration do { 'baz' => 'qux' } } }.with_indifferent_access end - it 'removes the offending backend_user_attributes sub-hash' do - expect { migrate } - .to change { Setting.get('ldap_config') } - .to(config.tap { |c| c[:wizardData].delete(:backend_user_attributes) }) + it 'makes no changes' do + expect { migrate }.not_to change { Setting.get('ldap_config') } end end end