From ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 20 Oct 2015 16:08:56 -0600 Subject: Merge pull request #20715 from simsalabim/feature/parse-rss-atom-as-xml parse RSS/ATOM responses as XML, not HTML --- actionpack/lib/action_dispatch/testing/assertions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/testing/assertions.rb b/actionpack/lib/action_dispatch/testing/assertions.rb index 8dd0bd63ad..715d94d406 100644 --- a/actionpack/lib/action_dispatch/testing/assertions.rb +++ b/actionpack/lib/action_dispatch/testing/assertions.rb @@ -12,7 +12,7 @@ module ActionDispatch include Rails::Dom::Testing::Assertions def html_document - @html_document ||= if @response.content_type === Mime[:xml] + @html_document ||= if @response.content_type.to_s =~ /xml$/ Nokogiri::XML::Document.parse(@response.body) else Nokogiri::HTML::Document.parse(@response.body) -- cgit v1.2.3