JC: added Rails.env.test? in routes.rb.