2014-12-08 00:06:28 +11:00
Feature : Jekyll responsive_image tag
2014-12-06 03:26:50 +11:00
A s a J e k y l l t e m p l a t e d e v e l o p e r
I w a n t t o i n c l u d e r e s p o n s i v e i m a g e s i n m y p a g e
Scenario : Simple image tag
2014-12-08 00:14:40 +11:00
Given I h a v e a r e s p o n s i v e _ i m a g e c o n f i g u r a t i o n w i t h " t e m p l a t e " s e t t o " _ i n c l u d e s / r e s p o n s i v e - i m a g e . h t m l "
2016-09-02 17:53:29 +10:00
And I h a v e a f i l e " i n d e x . h t m l " w i t h " { % r e s p o n s i v e _ i m a g e p a t h : a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g a l t : F o o b a r % } "
2014-12-06 03:26:50 +11:00
When I r u n J e k y l l
2016-09-02 17:53:29 +10:00
Then I s h o u l d s e e " < i m g a l t = \ " F o o b a r \ " s r c = \ " / a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g \ " " i n " _ s i t e / i n d e x . h t m l "
2014-12-06 10:55:10 +11:00
2015-11-05 20:02:16 +11:00
Scenario : Global variables available in templates
2016-09-02 17:53:29 +10:00
Given I h a v e a f i l e " i n d e x . h t m l " w i t h " { % r e s p o n s i v e _ i m a g e p a t h : a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g % } "
2015-11-05 20:02:16 +11:00
And I h a v e a c o n f i g u r a t i o n w i t h :
"""
b a s e u r l : h t t p s : / / w i l d l y i n a c c u r a t e . c o m
r e s p o n s i v e _ i m a g e :
t e m p l a t e : _ i n c l u d e s / b a s e - u r l . h t m l
"""
When I r u n J e k y l l
2016-09-02 17:53:29 +10:00
Then I s h o u l d s e e " <img src=\"https://wildlyinaccurate.com/assets/everybody-loves-jalapeño-pineapple-cornbread.png\"> " i n " _ s i t e / i n d e x . h t m l "
2015-11-05 20:02:16 +11:00
2014-12-06 12:21:53 +11:00
Scenario : Adding custom attributes
2014-12-08 00:14:40 +11:00
Given I h a v e a r e s p o n s i v e _ i m a g e c o n f i g u r a t i o n w i t h " t e m p l a t e " s e t t o " _ i n c l u d e s / r e s p o n s i v e - i m a g e . h t m l "
2014-12-06 12:21:53 +11:00
And I h a v e a f i l e " i n d e x . h t m l " w i t h :
"""
2016-09-02 17:53:29 +10:00
{ % r e s p o n s i v e _ i m a g e p a t h : a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g a l t : ' F o o b a r b a z b a r ' t i t l e : " L o r e m I p s u m " % }
2014-12-06 12:21:53 +11:00
"""
When I r u n J e k y l l
2016-09-02 17:53:29 +10:00
Then I s h o u l d s e e " < i m g a l t = \ " F o o b a r b a z b a r \ " s r c = \ " / a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g \ " t i t l e = \ " L o r e m I p s u m \ " " i n " _ s i t e / i n d e x . h t m l "
2014-12-06 12:21:53 +11:00
Scenario : UTF-8 attributes
2014-12-08 00:14:40 +11:00
Given I h a v e a r e s p o n s i v e _ i m a g e c o n f i g u r a t i o n w i t h " t e m p l a t e " s e t t o " _ i n c l u d e s / r e s p o n s i v e - i m a g e . h t m l "
2016-09-02 17:53:29 +10:00
And I h a v e a f i l e " i n d e x . h t m l " w i t h " { % r e s p o n s i v e _ i m a g e p a t h : a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g a l t : ' か っ こ い い ! ジ ェ ケ ル が 好 き で す ! ' % } "
2014-12-06 10:55:10 +11:00
When I r u n J e k y l l
2016-09-02 17:53:29 +10:00
Then I s h o u l d s e e " < i m g a l t = \ " か っ こ い い ! ジ ェ ケ ル が 好 き で す ! \ " s r c = \ " / a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g \ " " i n " _ s i t e / i n d e x . h t m l "
2014-12-06 10:55:10 +11:00
Scenario : Image with multiple sizes
Given I h a v e a r e s p o n s i v e _ i m a g e c o n f i g u r a t i o n w i t h :
"""
t e m p l a t e : _ i n c l u d e s / r e s p o n s i v e - i m a g e . h t m l
s i z e s :
- w i d t h : 100
- w i d t h : 200
"""
2016-09-26 06:37:10 +10:00
And I h a v e a f i l e " i n d e x . h t m l " w i t h " { % r e s p o n s i v e _ i m a g e p a t h : a s s e t s / s u b d i r / t e s t . p n g % } "
2014-12-06 10:55:10 +11:00
When I r u n J e k y l l
2016-09-26 06:37:10 +10:00
Then I s h o u l d s e e " < i m g a l t = \ " \ " s r c = \ " / a s s e t s / s u b d i r / t e s t . p n g \ " " i n " _ s i t e / i n d e x . h t m l "
And I s h o u l d s e e " / a s s e t s / r e s i z e d / t e s t - 1 0 0 x 5 0 . p n g 1 0 0 w , / a s s e t s / r e s i z e d / t e s t - 2 0 0 x 1 0 0 . p n g 2 0 0 w , / a s s e t s / s u b d i r / t e s t . p n g 3 0 0 w " i n " _ s i t e / i n d e x . h t m l "
2014-12-07 02:33:38 +11:00
Scenario : Overriding the template
Given I h a v e a r e s p o n s i v e _ i m a g e c o n f i g u r a t i o n w i t h :
"""
t e m p l a t e : _ i n c l u d e s / r e s p o n s i v e - i m a g e . h t m l
s i z e s :
2016-09-26 06:37:10 +10:00
- w i d t h : 50
2014-12-07 02:33:38 +11:00
- w i d t h : 100
"""
2016-09-02 17:53:29 +10:00
And I h a v e a f i l e " i n d e x . h t m l " w i t h " { % r e s p o n s i v e _ i m a g e p a t h : a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g t e m p l a t e : _ i n c l u d e s / c u s t o m - t e m p l a t e . h t m l % } "
2014-12-07 02:33:38 +11:00
When I r u n J e k y l l
2016-10-19 08:07:36 +11:00
Then I s h o u l d s e e " [ 5 0 , 1 0 0 ] " i n " _ s i t e / i n d e x . h t m l "
2014-12-07 09:28:21 +11:00
Scenario : Overriding the generated filenames
Given I h a v e a r e s p o n s i v e _ i m a g e c o n f i g u r a t i o n w i t h :
"""
t e m p l a t e : _ i n c l u d e s / r e s p o n s i v e - i m a g e . h t m l
2015-12-28 09:41:04 +11:00
o u t p u t _ p a t h _ f o r m a t : a s s e t s / % { d i r n a m e } / % { b a s e n a m e } - r e s i z e d / % { w i d t h } / % { f i l e n a m e } - % { h e i g h t } . % { e x t e n s i o n }
2014-12-07 09:28:21 +11:00
s i z e s :
- w i d t h : 100
"""
2016-09-02 17:53:29 +10:00
And I h a v e a f i l e " i n d e x . h t m l " w i t h " { % r e s p o n s i v e _ i m a g e p a t h : a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g % } "
2014-12-07 09:28:21 +11:00
When I r u n J e k y l l
2016-09-02 17:53:29 +10:00
Then I s h o u l d s e e " / a s s e t s / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d . p n g - r e s i z e d / 1 0 0 / e v e r y b o d y - l o v e s - j a l a p e ñ o - p i n e a p p l e - c o r n b r e a d - 5 0 . p n g 1 0 0 w " i n " _ s i t e / i n d e x . h t m l "