|
| 1 | +# Wiki Extensions plugin for Redmine |
| 2 | +# Copyright (C) 2009-2010 Haruyuki Iida |
| 3 | +# |
| 4 | +# This program is free software; you can redistribute it and/or |
| 5 | +# modify it under the terms of the GNU General Public License |
| 6 | +# as published by the Free Software Foundation; either version 2 |
| 7 | +# of the License, or (at your option) any later version. |
| 8 | +# |
| 9 | +# This program is distributed in the hope that it will be useful, |
| 10 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | +# GNU General Public License for more details. |
| 13 | +# |
| 14 | +# You should have received a copy of the GNU General Public License |
| 15 | +# along with this program; if not, write to the Free Software |
| 16 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | + |
| 18 | +require File.expand_path('../test_helper', __dir__) |
| 19 | + |
| 20 | +class WikiExtensionsMacroVideoTest < ActiveSupport::TestCase |
| 21 | + include ApplicationHelper |
| 22 | + include ActionDispatch::Assertions::SelectorAssertions |
| 23 | + include ERB::Util |
| 24 | + |
| 25 | + def test_video_tag_macro |
| 26 | + with_settings :text_formatting => 'textile' do |
| 27 | + result = textilizable("{{video_tag(https://samplelib.com/lib/preview/mp4/sample-5s.mp4, 320, 240, controls autoplay muted)}}") |
| 28 | + |
| 29 | + assert_select_in result, 'video[src="https://samplelib.com/lib/preview/mp4/sample-5s.mp4"]' |
| 30 | + assert_select_in result, 'video[width="320"]' |
| 31 | + assert_select_in result, 'video[height="240"]' |
| 32 | + assert_select_in result, 'video[controls]' |
| 33 | + assert_select_in result, 'video[autoplay]' |
| 34 | + assert_select_in result, 'video[muted]' |
| 35 | + end |
| 36 | + end |
| 37 | +end |
0 commit comments