diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-06-21 19:24:00 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-06-27 18:16:07 +0300 |
commit | c7b04841c0b742146d88c63b83f6ac4474e77e05 (patch) | |
tree | a7ffe29f706a3acf0abf9a7070c51b660fed4b6b /spec/lib/banzai/filter | |
parent | f48f7760c26e681e3f8b011c7c4e2b6ccfc9c3f5 (diff) |
Wrap images in divs with Banzai and limit max-height.
Add max-height to prevent images from displaying larger than the provided screen size.
Also fix a failing test and add a new one.
Diffstat (limited to 'spec/lib/banzai/filter')
-rw-r--r-- | spec/lib/banzai/filter/image_link_filter_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/image_link_filter_spec.rb b/spec/lib/banzai/filter/image_link_filter_spec.rb index dd5594750c8..a2a1ed58d1b 100644 --- a/spec/lib/banzai/filter/image_link_filter_spec.rb +++ b/spec/lib/banzai/filter/image_link_filter_spec.rb @@ -21,4 +21,9 @@ describe Banzai::Filter::ImageLinkFilter, lib: true do doc = filter(image('https://i.imgur.com/DfssX9C.jpg')) expect(doc.at_css('img')['src']).to eq doc.at_css('a')['href'] end + + it 'wraps the image with a link and a div' do + doc = filter(image('/uploads/e90decf88d8f96fe9e1389afc2e4a91f/test.jpg')) + expect(doc.to_html).to include('<div class="image-container">') + end end |