Files
grecia/spec/system/images_spec.rb
taitus 78ee45630b Remove metadata from images
Currently in the application we never show the original image, we always
show one of its variants.

This change removes the metadata of both the variants and the original
version so that if at some point we decide to show the original version,
we will no longer have to remember to remove the metadata.
2023-06-12 14:30:00 +02:00

26 lines
676 B
Ruby

require "rails_helper"
describe "Images" do
before { Setting["uploads.images.min_height"] = 0 }
describe "Metadata" do
let(:image) { create(:image, attachment: fixture_file_upload("logo_header_with_metadata.jpg")) }
scenario "download original images without metadata" do
visit polymorphic_path(image.variant(nil))
file = MiniMagick::Image.open(page.find("img")["src"])
expect(file.exif).to be_empty
end
scenario "download transformed images without metadata" do
visit polymorphic_path(image.variant(:large))
file = MiniMagick::Image.open(page.find("img")["src"])
expect(file.exif).to be_empty
end
end
end