mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
Active Storage reads stored strings as ASCII and that can clash with Rails' default UTF-8 encoding when special characters are present.
16 lines
367 B
Ruby
16 lines
367 B
Ruby
# 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
|