encodings_spec.rb 668 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Mail::Encodings do
  4. # Regression test for https://github.com/zammad/zammad/issues/2456
  5. # (Mail lib was originally broken, so we patched it.
  6. # Then, upstream was fixed, whereas our patch broke.)
  7. describe '.value_decode' do
  8. it 'decodes us-ascii encoded strings' do
  9. expect(described_class.value_decode('=?us-ascii?Q?Test?='))
  10. .to eql('Test')
  11. end
  12. it 'decodes utf-8 encoded strings' do
  13. expect(described_class.value_decode('=?UTF-8?Q? Personal=C3=A4nderung?='))
  14. .to eql(' Personaländerung')
  15. end
  16. end
  17. end