| Module | ThoughtBot::Shoulda::Controller::XML |
| In: |
lib/shoulda/controller_tests/formats/xml.rb
|
Asserts that the controller‘s response was ‘application/xml‘
# File lib/shoulda/controller_tests/formats/xml.rb, line 157
157: def assert_xml_response
158: content_type = (@response.headers["Content-Type"] || @response.headers["type"]).to_s
159: regex = %r{\bapplication/xml\b}
160:
161: msg = "Content Type '#{content_type.inspect}' doesn't match '#{regex.inspect}'\n"
162: msg += "Body: #{@response.body.first(100).chomp} ..."
163:
164: assert_match regex, content_type, msg
165: end