diff --git a/config/initializers/premailer.rb b/config/initializers/premailer.rb index ad80d80f0797cbcc779cab91e05c8d969fe4d7c9..687f56eb884a0e7760bfbee12747dcacb6a63ba5 100644 --- a/config/initializers/premailer.rb +++ b/config/initializers/premailer.rb @@ -7,6 +7,5 @@ remove_comments: true, remove_ids: false, remove_scripts: false, - output_encoding: 'US-ASCII', strategies: ::Rails.env.production? ? [:asset_pipeline] : [:asset_pipeline, :network] ) diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 9dcb0cdf103e2ffedb820dcfda32b357c362d147..f845a39735120b2f19be17fc4262b8f3c655df8a 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -89,16 +89,16 @@ end end - describe 'with HTML-encoded entities' do + describe 'with non-ASCII characters' do before do - described_class.test_email('test@test.com', 'Subject', 'Some body with —').deliver + described_class.test_email('test@test.com', 'Subject', 'Some body with ä¸æ–‡ —').deliver end subject { ActionMailer::Base.deliveries.last } - it 'retains 7bit encoding' do - expect(subject.body.ascii_only?).to eq(true) - expect(subject.body.encoding).to eq('7bit') + it 'removes HTML encoding and uses UTF-8 charset' do + expect(subject.charset).to eq('UTF-8') + expect(subject.body).to include('ä¸æ–‡ —') end end