DEV: ensure resizing test does not raise bad error
Current resizing test was showing binary diff in terminal and failing in latest image magick 7, this fixes both issues
This commit is contained in:
parent
bafe3cd99a
commit
bea8d337b2
|
@ -37,6 +37,8 @@ describe OptimizedImage do
|
||||||
# we use "filename" to get the correct extension here, it is more important
|
# we use "filename" to get the correct extension here, it is more important
|
||||||
# then any other param
|
# then any other param
|
||||||
|
|
||||||
|
orig_size = File.size(original_path)
|
||||||
|
|
||||||
OptimizedImage.resize(
|
OptimizedImage.resize(
|
||||||
original_path,
|
original_path,
|
||||||
original_path,
|
original_path,
|
||||||
|
@ -45,9 +47,8 @@ describe OptimizedImage do
|
||||||
filename: "test.png"
|
filename: "test.png"
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(File.read(original_path)).to eq(
|
expect(orig_size).to be > File.size(original_path)
|
||||||
File.read("#{Rails.root}/spec/fixtures/images/resized.png")
|
|
||||||
)
|
|
||||||
ensure
|
ensure
|
||||||
File.delete(original_path) if File.exists?(original_path)
|
File.delete(original_path) if File.exists?(original_path)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue