Add a request spec for the "Add placement" journey #825
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Request specs are useful for covering behaviours and side effects which aren't strictly user facing.
They can be used when the scenario is difficult to reproduce in a system spec (for example, requesting paths which can't be navigated to using the UI), or where the expected behaviour can't be asserted directly from the UI (for example, to check that email or Slack notifications are triggered in response to a user's actions).
Changes proposed in this pull request
I've added request specs to cover the following "Add placement" journeys:
I've also moved the system spec for adding a placement in the support console, so the spec file sits alongside other related specs. It wasn't easy to find in its original location.
Guidance to review
No specific guidance, but...
A note on "DRY"
I recognise that the two request specs added here are very similar. I've chosen not to try and DRY-up the test into a shared example.
My reasoning behind that decision:
*_path
route helpers because the requests go to different controllers.If anybody has strong opinions about whether I should DRY-up these tests or not, I'm happy to hear them!
Link to Trello card
https://trello.com/c/nvYNw8IB/543-add-test-coverage-for-add-placement-journey-edge-cases-and-side-effects