mozilla/kuma — pull request #351 by darkwing (2012-07-06 19:21:54+00:00)
Title: Rewrite of slug logic, tests

This update cuts down on repeated code in slug handling (parent and child relationships), as well as dozens of tests (in one) to accommodate for every situation I can think of. All spot checks work, all tests pass. Test:

- Invalid submission of new documents (parent, child, grandchild)
- Valid submission of new documents (parent, child, grandchild)

- Invalid submission of edited documents (parent, child, grandchild)
- Valid submission of edited documents (parent, child, grandchild)

- Invalid submission of translated documents (parent, child, grandchild)
- Valid submission of translated documents (parent, child, grandchild)

- Invalid submission of edited translated documents (parent, child, grandchild)
- Valid submission of edited translated documents (parent, child, grandchild)

Checks for:

- Presence (and lack of) of redirects
- Response codes
- Document existing
- Matching slugs

I did this so we could all sleep better at night.