Fix tests to catch the bug

This commit is contained in:
Joseph Wynn 2016-09-25 21:23:05 +01:00
parent 606870273e
commit 34d47b8d44
2 changed files with 7 additions and 11 deletions

View File

@ -43,14 +43,13 @@ Feature: Jekyll responsive_image tag
- width: 100
- width: 200
"""
And I have a file "index.html" with "{% responsive_image path: assets/everybody-loves-jalapeño-pineapple-cornbread.png %}"
And I have a file "index.html" with "{% responsive_image path: assets/subdir/test.png %}"
When I run Jekyll
Then I should see "<img alt=\"\" src=\"/assets/everybody-loves-jalapeño-pineapple-cornbread.png\"" in "_site/index.html"
And I should see "/assets/resized/everybody-loves-jalapeño-pineapple-cornbread-100x50.png 100w" in "_site/index.html"
And I should see "/assets/resized/everybody-loves-jalapeño-pineapple-cornbread-200x100.png 200w" in "_site/index.html"
And I should see "/assets/everybody-loves-jalapeño-pineapple-cornbread.png 300w" in "_site/index.html"
And the file "assets/resized/everybody-loves-jalapeño-pineapple-cornbread-100x50.png" should exist
And the file "assets/resized/everybody-loves-jalapeño-pineapple-cornbread-200x100.png" should exist
Then I should see "<img alt=\"\" src=\"/assets/subdir/test.png\"" in "_site/index.html"
And I should see "/assets/resized/test-100x50.png 100w,/assets/resized/test-200x100.png 200w,/assets/subdir/test.png 300w" in "_site/index.html"
And the file "assets/resized/test-100x50.png" should exist
And the file "assets/resized/test-200x100.png" should exist
Scenario: Overriding the template
Given I have a responsive_image configuration with:

View File

@ -1,4 +1 @@
<img alt="{{ alt }}" src="/{{ path }}" title="{{ title }}" srcset="
{% for i in resized %}/{{ i.path }} {{ i.width }}w,{% endfor %}
/{{ original.path }} {{ original.width }}w
">
<img alt="{{ alt }}" src="/{{ path }}" title="{{ title }}" srcset="{% for i in resized %}/{{ i.path }} {{ i.width }}w,{% endfor %}/{{ original.path }} {{ original.width }}w">