RE: teampoltergeist/poltergeist#44
Use Rack::SimpleEndpoint
to prevent Poltergeist/PhantomJS from crashing on TTF fonts.
In config/environments/test.rb
, add
require 'rack/contrib/simple_endpoint'
config.middleware.insert_after Rack::Runtime, Rack::SimpleEndpoint, /\.ttf$/ do |req, res, match|
res.status = '403'
"I will not serve TTF fonts in test mode."