namespace :test_pdf do
  desc 'Generate and open a PDF for the last finished response'
  task generate: :environment do
    filename = File.join(Rails.root, 'tmp', 'test.pdf')
    uuid = Events::ResponseFinished.last.response_uuid
    response = Response.find(uuid)
    pdf = ResponseReport.new(response)
    pdf.render_file filename
    puts "Generated PDF report: #{filename}"
    system %(open "#{filename}")
  end
end

Add rake task for faster testing of pdf report
Add rake task for faster testing of pdf report
