Revert "DEV: Remove the remaining ENV["TRAVIS"] usage (#10041)"

This reverts commit 78aff841e3215c875e79692fbeaf8d18c4514006.

See https://review.discourse.org/t/dev-remove-the-remaining-env-travis-usage-10041/12737/4?u=cvx
This commit is contained in:
Jarek Radosz
2020-06-16 19:36:40 +02:00
parent 78aff841e3
commit 669c940ec3
4 changed files with 85 additions and 56 deletions

View File

@ -6,29 +6,31 @@ describe OptimizedImage do
let(:upload) { build(:upload) }
before { upload.id = 42 }
describe '.crop' do
it 'should produce cropped images (requires ImageMagick 7)' do
tmp_path = "/tmp/cropped.png"
unless ENV["TRAVIS"]
describe '.crop' do
it 'should produce cropped images (requires ImageMagick 7)' do
tmp_path = "/tmp/cropped.png"
begin
OptimizedImage.crop(
"#{Rails.root}/spec/fixtures/images/logo.png",
tmp_path,
5,
5
)
begin
OptimizedImage.crop(
"#{Rails.root}/spec/fixtures/images/logo.png",
tmp_path,
5,
5
)
# we don't want to deal with something new here every time image magick
# is upgraded or pngquant is upgraded, lets just test the basics ...
# cropped image should be less than 120 bytes
# we don't want to deal with something new here every time image magick
# is upgraded or pngquant is upgraded, lets just test the basics ...
# cropped image should be less than 120 bytes
cropped_size = File.size(tmp_path)
cropped_size = File.size(tmp_path)
expect(cropped_size).to be < 120
expect(cropped_size).to be > 50
expect(cropped_size).to be < 120
expect(cropped_size).to be > 50
ensure
File.delete(tmp_path) if File.exists?(tmp_path)
ensure
File.delete(tmp_path) if File.exists?(tmp_path)
end
end
end