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.
What github issue is this PR for, if any?
This fixes some flaky tests.
This also speeds up test times for
spec/system/casa_cases/edit_spec.rb
What changed, and why?
This addresses two main types of changes
visit
call was unneeded because the page to visit was already the page that the controller redirects to.to
assertions before any.not_to
assertions whenever practicable.Using
expect(page).to have_current_path(expected_path)
does count as putting a positive assertion first that helps with not doubling the wait time . Thehave_current_path
matcher was intentionally written with this goal in mind.How is this tested? (please write rspec and jest tests!) 💖💪
I tested it locally repeatedly and the edited tests pass reliably.
Feelings gif (optional)