Skip to content

Commit

Permalink
Fix tests to catch the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wildlyinaccurate committed Sep 25, 2016
1 parent 6068702 commit 34d47b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
13 changes: 6 additions & 7 deletions features/responsive-image-tag.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 1 addition & 4 deletions features/test-site/_includes/responsive-image.html
Original file line number Diff line number Diff line change
@@ -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">

0 comments on commit 34d47b8

Please sign in to comment.