diff options
author | Robert Speicher <robert@gitlab.com> | 2017-02-27 19:23:05 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-02-27 19:23:05 +0000 |
commit | e051ef69e3adb5d8a06a5f7fb5719c7987fe4841 (patch) | |
tree | cb43939bec4425130b380d45e80c1ad0c80f6a0d /spec/lib/banzai | |
parent | 5cd79bd641c4cd473da768b08ef18dc285f10b8e (diff) | |
parent | b8cab61ff016156e8c527322bb72d4185d752e44 (diff) | |
download | gitlab-ce-e051ef69e3adb5d8a06a5f7fb5719c7987fe4841.tar.gz |
Merge branch '20890-comment-image-inline' into 'master'
28711-cherry-picking-ui-regressions-8-17-0
Fix inline comment images by removing wrapper #20890
Closes #20890
See merge request !5804
Diffstat (limited to 'spec/lib/banzai')
-rw-r--r-- | spec/lib/banzai/filter/image_link_filter_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/lib/banzai/filter/image_link_filter_spec.rb b/spec/lib/banzai/filter/image_link_filter_spec.rb index a2a1ed58d1b..294558b3db2 100644 --- a/spec/lib/banzai/filter/image_link_filter_spec.rb +++ b/spec/lib/banzai/filter/image_link_filter_spec.rb @@ -13,8 +13,8 @@ describe Banzai::Filter::ImageLinkFilter, lib: true do end it 'does not wrap a duplicate link' do - exp = act = %q(<a href="/whatever">#{image('/uploads/e90decf88d8f96fe9e1389afc2e4a91f/test.jpg')}</a>) - expect(filter(act).to_html).to eq exp + doc = filter(%Q(<a href="/whatever">#{image('/uploads/e90decf88d8f96fe9e1389afc2e4a91f/test.jpg')}</a>)) + expect(doc.to_html).to match /^<a href="\/whatever"><img[^>]*><\/a>$/ end it 'works with external images' do @@ -22,8 +22,8 @@ describe Banzai::Filter::ImageLinkFilter, lib: true do 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">') + it 'works with inline images' do + doc = filter(%Q(<p>test #{image('/uploads/e90decf88d8f96fe9e1389afc2e4a91f/test.jpg')} inline</p>)) + expect(doc.to_html).to match /^<p>test <a[^>]*><img[^>]*><\/a> inline<\/p>$/ end end |