提交 bc87e212 编写于 作者: A Akira Matsuda

String#end_with? should be faster than Regexp here

上级 24bacb3e
......@@ -12,7 +12,7 @@ module Assertions
include Rails::Dom::Testing::Assertions
def html_document
@html_document ||= if @response.content_type.to_s =~ /xml\z/
@html_document ||= if @response.content_type.to_s.end_with?("xml")
Nokogiri::XML::Document.parse(@response.body)
else
Nokogiri::HTML::Document.parse(@response.body)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册