Write tests for auto_rotate option

This commit is contained in:
Joseph Wynn 2017-03-12 14:14:53 +00:00
parent ffc51f648b
commit 73bd82d547
2 changed files with 28 additions and 0 deletions

View File

@ -62,3 +62,31 @@ Feature: Responsive image generation
When I run Jekyll When I run Jekyll
Then the image "my-site-copy/src/assets/resized/subdir/100/test.png" should have the dimensions "100x50" Then the image "my-site-copy/src/assets/resized/subdir/100/test.png" should have the dimensions "100x50"
And the file "_site/assets/resized/subdir/100/test.png" should exist And the file "_site/assets/resized/subdir/100/test.png" should exist
Scenario: Images can be auto-rotated based on EXIF rotation
Given I have a responsive_image configuration with:
"""
template: _includes/responsive-image.html
sizes:
- width: 100
auto_rotate: true
"""
And I have a file "index.html" with "{% responsive_image path: assets/exif-rotation.jpeg %}"
When I run Jekyll
Then the file "_site/assets/resized/exif-rotation-100x200.jpeg" should exist
Scenario: Images aren't auto-rotated by default
Given I have a responsive_image configuration with:
"""
template: _includes/responsive-image.html
sizes:
- width: 100
"""
And I have a file "index.html" with:
"""
{% responsive_image path: assets/exif-rotation.jpeg %}
{% responsive_image path: assets/progressive.jpeg %}
"""
When I run Jekyll
Then the file "_site/assets/resized/exif-rotation-100x50.jpeg" should exist
Then the file "_site/assets/resized/progressive-100x50.jpeg" should exist

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB