public
Rubygem
Description: RSpec extension library for Ruby on Rails
Homepage:
Clone URL: git://github.com/dchelimsky/rspec-rails.git
check for blank Content-Type header before converting it to a Symbol
David Chelimsky (author)
Sat Aug 23 13:45:02 -0700 2008
commit  2cddc904bdfb70bf201123d4fc6731512cde5482
tree    6dc3d2eddac9fb0ad18d0c20f3f295eada2d89a6
parent  95ad614951ab8540b25453f5135ad46e106986ba
...
16
17
18
19
 
20
21
22
...
16
17
18
 
19
20
21
22
0
@@ -16,7 +16,7 @@ module Spec # :nodoc:
0
         def matches?(response_or_text, &block)
0
           if ActionController::TestResponse === response_or_text and
0
                    response_or_text.headers.key?('Content-Type') and
0
-                   response_or_text.headers['Content-Type'] and
0
+                   !response_or_text.headers['Content-Type'].blank? and
0
                    response_or_text.headers['Content-Type'].to_sym == :xml
0
             @args.unshift(HTML::Document.new(response_or_text.body, false, true).root)           
0
           elsif String === response_or_text

Comments