diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-20 16:08:56 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-20 16:11:36 -0600 |
commit | ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9 (patch) | |
tree | ff78ca5fc4a1ea01ab44ab8afb7d7f536cd7d289 /actionpack/lib/action_dispatch/testing | |
parent | 61e65f606035778367cc52d7d0be190ff00e27ab (diff) | |
download | rails-ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9.tar.gz rails-ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9.tar.bz2 rails-ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9.zip |
Merge pull request #20715 from simsalabim/feature/parse-rss-atom-as-xml
parse RSS/ATOM responses as XML, not HTML
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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) |