From cfa5faaae0d9ac9a3c1fafb1a41e07b298029f48 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 18 Jan 2022 00:24:03 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-6-stable-ee --- ...tic_objects_external_storage_auth_token_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec/migrations') diff --git a/spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb b/spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb index bc8b7c56676..bf4094eaa49 100644 --- a/spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb +++ b/spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb @@ -53,4 +53,26 @@ RSpec.describe EncryptStaticObjectsExternalStorageAuthToken, :migration do end end end + + context 'when static_objects_external_storage_auth_token is empty string' do + it 'does not break' do + settings = application_settings.create! + settings.update_column(:static_objects_external_storage_auth_token, '') + + reversible_migration do |migration| + migration.before -> { + settings = application_settings.first + + expect(settings.static_objects_external_storage_auth_token).to eq('') + expect(settings.static_objects_external_storage_auth_token_encrypted).to be_nil + } + migration.after -> { + settings = application_settings.first + + expect(settings.static_objects_external_storage_auth_token).to eq('') + expect(settings.static_objects_external_storage_auth_token_encrypted).to be_nil + } + end + end + end end -- cgit v1.2.3