diff options
author | Boris Peterbarg <boris@seekingalpha.com> | 2015-03-15 17:35:58 +0200 |
---|---|---|
committer | Boris Peterbarg <boris@seekingalpha.com> | 2015-03-16 06:35:00 +0200 |
commit | 4be3997c9f317e4295421d31204a31962206b55c (patch) | |
tree | 7c7852c1afbcc3bd6305962184444bf9316cfde4 /actionpack/lib | |
parent | a5a4b56029f1a83cfc81852f8ca76f9161abcbaa (diff) | |
download | rails-4be3997c9f317e4295421d31204a31962206b55c.tar.gz rails-4be3997c9f317e4295421d31204a31962206b55c.tar.bz2 rails-4be3997c9f317e4295421d31204a31962206b55c.zip |
Compare content_type with Mime::XML instead of regexp
Regexp is broken for both content types including charsets and for
integration tests, where the content_type is a Mime::Type and not String
Diffstat (limited to 'actionpack/lib')
-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 f325c35b57..21b3b89d22 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 =~ /xml$/ + @html_document ||= if @response.content_type === Mime::XML Nokogiri::XML::Document.parse(@response.body) else Nokogiri::HTML::Document.parse(@response.body) |