encodings_spec.rb 591 B

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