require "test_helper" class HTML::Pipeline::TrixVideoFilterTest < Minitest::Test TrixVideoFilter = HTML::Pipeline::TrixVideoFilter def test_it_converts_youtube_figures_into_youtube_urls assert_equal_html "https://youtube.com/watch?v=FTfrKOQFPNA", TrixVideoFilter.call(youtube_figure) end def test_it_converts_vimeo_figures_into_vimeo_urls assert_equal_html "https://vimeo.com/187229876", TrixVideoFilter.call(vimeo_figure) end def test_it_leaves_other_figures_alone assert_equal_html image_figure, TrixVideoFilter.call(image_figure) end private def youtube_figure "
" end def vimeo_figure "
" end def image_figure "
with a caption!
" end end