diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-28 06:10:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-28 06:10:17 +0000 |
commit | cf73ed7d11fdf517c230038fe8c88c96b7e3d6f0 (patch) | |
tree | 2bff9cfe778217ae462963ff4c22bb80bd274969 /spec/lib/banzai | |
parent | c01895daab6ec8bffc5466a8330fc154fd47a726 (diff) | |
download | gitlab-ce-cf73ed7d11fdf517c230038fe8c88c96b7e3d6f0.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/banzai')
-rw-r--r-- | spec/lib/banzai/filter/audio_link_filter_spec.rb | 16 | ||||
-rw-r--r-- | spec/lib/banzai/filter/video_link_filter_spec.rb | 16 |
2 files changed, 10 insertions, 22 deletions
diff --git a/spec/lib/banzai/filter/audio_link_filter_spec.rb b/spec/lib/banzai/filter/audio_link_filter_spec.rb index 4198a50e980..71e069eb29f 100644 --- a/spec/lib/banzai/filter/audio_link_filter_spec.rb +++ b/spec/lib/banzai/filter/audio_link_filter_spec.rb @@ -25,18 +25,14 @@ RSpec.describe Banzai::Filter::AudioLinkFilter do it 'replaces the image tag with an audio tag' do container = filter(image).children.first - expect(container.name).to eq 'div' - expect(container['class']).to eq 'audio-container' + expect(container.name).to eq 'span' + expect(container['class']).to eq 'media-container audio-container' - audio, paragraph = container.children + audio, link = container.children expect(audio.name).to eq 'audio' expect(audio['src']).to eq src - expect(paragraph.name).to eq 'p' - - link = paragraph.children.first - expect(link.name).to eq 'a' expect(link['href']).to eq src expect(link['target']).to eq '_blank' @@ -105,15 +101,13 @@ RSpec.describe Banzai::Filter::AudioLinkFilter do image = %(<img src="#{proxy_src}" data-canonical-src="#{canonical_src}"/>) container = filter(image).children.first - expect(container['class']).to eq 'audio-container' + expect(container['class']).to eq 'media-container audio-container' - audio, paragraph = container.children + audio, link = container.children expect(audio['src']).to eq proxy_src expect(audio['data-canonical-src']).to eq canonical_src - link = paragraph.children.first - expect(link['href']).to eq proxy_src end end diff --git a/spec/lib/banzai/filter/video_link_filter_spec.rb b/spec/lib/banzai/filter/video_link_filter_spec.rb index ec954aa9163..a0b0ba309f5 100644 --- a/spec/lib/banzai/filter/video_link_filter_spec.rb +++ b/spec/lib/banzai/filter/video_link_filter_spec.rb @@ -25,20 +25,16 @@ RSpec.describe Banzai::Filter::VideoLinkFilter do it 'replaces the image tag with a video tag' do container = filter(image).children.first - expect(container.name).to eq 'div' - expect(container['class']).to eq 'video-container' + expect(container.name).to eq 'span' + expect(container['class']).to eq 'media-container video-container' - video, paragraph = container.children + video, link = container.children expect(video.name).to eq 'video' expect(video['src']).to eq src expect(video['width']).to eq "400" expect(video['preload']).to eq 'metadata' - expect(paragraph.name).to eq 'p' - - link = paragraph.children.first - expect(link.name).to eq 'a' expect(link['href']).to eq src expect(link['target']).to eq '_blank' @@ -107,15 +103,13 @@ RSpec.describe Banzai::Filter::VideoLinkFilter do image = %(<img src="#{proxy_src}" data-canonical-src="#{canonical_src}"/>) container = filter(image).children.first - expect(container['class']).to eq 'video-container' + expect(container['class']).to eq 'media-container video-container' - video, paragraph = container.children + video, link = container.children expect(video['src']).to eq proxy_src expect(video['data-canonical-src']).to eq canonical_src - link = paragraph.children.first - expect(link['href']).to eq proxy_src end end |