Merge pull request #10762 from mkllnk/report-encoding

Preserve encoding of stored reports
This commit is contained in:
Konrad
2023-05-03 17:08:44 +02:00
committed by GitHub
3 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
# frozen_string_literal: false
require 'spec_helper'
describe ReportBlob, type: :model do
it "preserves UTF-8 content" do
blob = ReportBlob.create_for_upload_later!("customers.html")
content = "This works. ✓"
expect do
blob.store(content)
content = blob.result
end.to_not change { content.encoding }.from(Encoding::UTF_8)
end
end