From cf73ed7d11fdf517c230038fe8c88c96b7e3d6f0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Sat, 28 Aug 2021 06:10:17 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/lib/banzai/filter/audio_link_filter_spec.rb | 16 +++++----------- spec/lib/banzai/filter/video_link_filter_spec.rb | 16 +++++----------- 2 files changed, 10 insertions(+), 22 deletions(-) (limited to 'spec/lib/banzai') 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 = %() 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 = %() 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 -- cgit v1.2.1