diff --git a/spec/images/invalid1.png b/spec/images/invalid1.png deleted file mode 100644 index 436d87eb..00000000 Binary files a/spec/images/invalid1.png and /dev/null differ diff --git a/spec/save_images_spec.rb b/spec/save_images_spec.rb index b4f89774..9284c456 100644 --- a/spec/save_images_spec.rb +++ b/spec/save_images_spec.rb @@ -76,16 +76,21 @@ it "creates a dummy invalid image" do allow(saving).to receive(:attempt_image_capture).and_raise("boom") # Create the image at the original res of the invalid image, so that we - # can compare it's md5 easily + # can compare its md5 easily jobs = [ ['test', '/test/path', '1500x1500', test_url1, test_image1, nil, nil, nil, 'invalid1.jpg'] ] saving.parallel_task(jobs) - # Test fixture image created from the original invalid image because - # the original is a jpg - invalid_image = get_path_relative_to __FILE__, "./images/invalid1.png" - invalid_md5 = Digest::MD5.hexdigest(File.read(invalid_image)) + # Create the expected image so we can compare them, because they'll + # differ between imagemagick versions and platforms and so we can't just + # use a fixture. + saving.create_invalid_image( + "shots/test/invalid1.png", + 1500, + "invalid1.jpg" + ) + invalid_md5 = Digest::MD5.hexdigest(File.read("shots/test/invalid1.png")) created_md5 = Digest::MD5.hexdigest(File.read(test_image1)) expect(created_md5).to eq invalid_md5 end