Add tests for tree edit routes

Critical because of possible confusion between /:id/preview
and /:id for a path that ends in preview.

The goal it to prevent a bug analogous to: https://github.com/gitlabhq/gitlabhq/pull/7977