Add tests for tree edit routes

Critical because of possible confusion between /:id/preview
and /:id for a path that ends in preview.
Merge pull request #7978 from cirosantilli/edit-preview-route-test

Add tests for tree edit routes