Change root_path named route if namespace is nil

As requested in #2837 I'm going to resubmit the proposed change with a spec proposal.

I tried to run existing specs with rails 4.0.x but they are failing and I don't know how to fix them, any hint?