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.
26 lines
676 B
Ruby
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
|