提交 e0d2207a 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #30786 from y-yagi/add_test_case_for_font_url

Add test case for `font_url`
......@@ -305,6 +305,24 @@ def url_for(*args)
%(font_path("font.ttf?123")) => %(/fonts/font.ttf?123)
}
FontUrlToTag = {
%(font_url("font.eot")) => %(http://www.example.com/fonts/font.eot),
%(font_url("font.eot#iefix")) => %(http://www.example.com/fonts/font.eot#iefix),
%(font_url("font.woff")) => %(http://www.example.com/fonts/font.woff),
%(font_url("font.ttf")) => %(http://www.example.com/fonts/font.ttf),
%(font_url("font.ttf?123")) => %(http://www.example.com/fonts/font.ttf?123),
%(font_url("font.ttf", host: "http://assets.example.com")) => %(http://assets.example.com/fonts/font.ttf)
}
UrlToFontToTag = {
%(url_to_font("font.eot")) => %(http://www.example.com/fonts/font.eot),
%(url_to_font("font.eot#iefix")) => %(http://www.example.com/fonts/font.eot#iefix),
%(url_to_font("font.woff")) => %(http://www.example.com/fonts/font.woff),
%(url_to_font("font.ttf")) => %(http://www.example.com/fonts/font.ttf),
%(url_to_font("font.ttf?123")) => %(http://www.example.com/fonts/font.ttf?123),
%(url_to_font("font.ttf", host: "http://assets.example.com")) => %(http://assets.example.com/fonts/font.ttf)
}
def test_autodiscovery_link_tag_with_unknown_type_but_not_pass_type_option_key
assert_raise(ArgumentError) do
auto_discovery_link_tag(:xml)
......@@ -547,6 +565,14 @@ def test_font_path
FontPathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
end
def test_font_url
FontUrlToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
end
def test_url_to_font_alias_for_font_url
UrlToFontToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
end
def test_video_audio_tag_does_not_modify_options
options = { autoplay: true }
video_tag("video", options)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册