-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4135 Individuals Requests Preserve Values #4142
4135 Individuals Requests Preserve Values #4142
Conversation
35f2d1f
to
6a331ca
Compare
Fixes rubyforgood#4135 When individuals requests were submitted with incorrect values the error page did not preserve correct or incorrect inputs. This was happening because the controller created a new request on error. Now the new request will be populated with the items from the failed request. I attempted to reuse the failed request, however, because the individuals request is a wrapper around a family request that behavior was not possible.
6a331ca
to
68187fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just had one suggestion.
expect(page).to have_content('Still need help? Submit a support ticket here and we will do our best to follow up with you via email.') | ||
end | ||
|
||
it "should show invalid values in the form" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we combine these 2? System specs are expensive, so let's get all our expectations together :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually already drafted a PR to move the input tests to request specs: #4147. So they are separate because the check for invalid values will remain a system test while the other stuff will moved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, since we're addressing it in a followup PR I'm OK with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dorner - so does that mean this one meets your approval now (sounds like it)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
@elasticspoon: Your PR |
Fixes #4135
When individuals requests were submitted with incorrect values the error page did not preserve correct or incorrect inputs.
This was happening because the controller created a new request on error. Now the new request will be populated with the items from the failed request.
Notes
I attempted to reuse the failed request, however, that was not possible.
The form expects a
FamilyRequest
. The service object that deals with the request does not create aFamilyRequest
, instead it reuses the family request service which does not store or create aFamilyRequest
. The other option would be do a large refactoring and add additional objects such as anIndividualRequest
andIndividaulRequestService
.That might be something worth doing, I chose not to just to get this bug fixed.
Type of change
How Has This Been Tested?
System Tests