class TestAssistant::FailureReporter
Factory class for generating a failure report summarising the last request and response sent in a particular test and opening it in a browser. Intended to aid in debugging and to be toggled on through the use of RSpec tags and configured using TestAssistant::Configuration#render_failed_responses
Public Class Methods
file_extension(content_type)
click to toggle source
# File lib/test_assistant/failure_reporter.rb, line 118 def self.file_extension(content_type) MIME::Types[content_type].first.extensions.first end
report(request, response)
click to toggle source
# File lib/test_assistant/failure_reporter.rb, line 105 def self.report(request, response) extension = file_extension(response.content_type) case extension when 'txt' TextReporter.new(request, response) when 'json' JsonReporter.new(request, response) else SummaryReporter.new(request, response, extension) end end