Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAY-1426] Redirect If Guide Doesn't Exist (#3653)
**What does this PR do?** - ✅ Redirect to parent guide if child guide doesn't exist (`guides/#{@parent}/#{@page}`) - ✅ Redirect to home if parent guide doesn't exist (`guides/#{@parent}`) - ✅ Add spec tests for guides controller - ✅ Fix TypeError by adding conditional **How to test?** Steps to confirm the desired behavior: 1. Go to /guides/getting_started/nonsense 2. You should be redirected to /guides/getting_started/ 3. Go to /guides/design_guidelines/nonsense 4. You should be redirected to /guides/design_guidelines/ 5. Go to /guides/nonsense 6. You should be redirected to the home page 7. Go to /guides/design_guidelines/typography 8. You should see a document on Typography 9. Go to /guides/getting_started/rails_&_react_setup 10. You should see a document on Ruby & React Setup #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [x] **TESTS** I have added test coverage to my code. --------- Co-authored-by: Sam Duncan <[email protected]>
- Loading branch information