From c009dff56027dc7a6156072b578e946db6e49c66 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sun, 10 Jul 2022 18:43:17 +0200 Subject: [PATCH] Test that all header image sizes exist --- spec/lib/exporter_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/lib/exporter_spec.rb b/spec/lib/exporter_spec.rb index 223176f5..4c1e00c2 100644 --- a/spec/lib/exporter_spec.rb +++ b/spec/lib/exporter_spec.rb @@ -223,7 +223,7 @@ RSpec.describe Exporter do }) Dir.mkdir("#{fake_rails_root}/public") - FileUtils.cp_r(Rails.root.join('public/images'), "#{fake_rails_root}/public/images") + FileUtils.cp_r(Rails.root.join("public/images"), "#{fake_rails_root}/public/images") allow(Rails).to receive(:root).and_return(fake_rails_root) end @@ -266,7 +266,9 @@ RSpec.describe Exporter do it "exports the header image" do subject dirname = instance.instance_variable_get(:@export_dirname) - expect(File.exist?("#{dirname}/pictures/header_web_banana_racc.jpg")).to eq(true) + %i[web mobile retina original].each do |size| + expect(File.exist?("#{dirname}/pictures/header_#{size}_banana_racc.jpg")).to eq(true) + end end end end