mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
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:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user