diff options
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
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 |