-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add presence validation for enic_reason #9604
Conversation
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.
How do you feel about adding specs for the endpoints that caused the Sentry errors?
I very feel! Yeahh Ill add that in |
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 think the tests aren't adding much value as they create Qualifications with an enic_reason
we want to solve the issue of existing Qualifications that don't have an enic_reason
first before we backfill. If we backfill first we run the risk of still having nil
s
e599be7
to
32b7580
Compare
32b7580
to
0bf155c
Compare
@@ -121,6 +121,15 @@ | |||
|
|||
expect(gcse.reload.grade).to eq('D') | |||
end | |||
|
|||
it 'does not raise validation error for enic_reason being nil' 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.
This test is just so we can be sure that when a user updates an existing qualification before the backfill PR, that we don't get enic_reason
validation error. But we still want to validate the presence of an enic_reason
on creation of any new qualifications. Reason for testing here is when we added the validation before it caused a validation error when updating a qualification. But as we now only validate on create this is expected test behaviour where it keeps the enic_reason
as nil for an existing qualification
0bf155c
to
3f76149
Compare
3f76149
to
cb68c1c
Compare
cb68c1c
to
9ab1495
Compare
9ab1495
to
2a97b21
Compare
Context
Enforce presence validation for
enic_reason
onApplicationQualifications
ONLY on createChanges proposed in this pull request
Add
validates :enic_reason, presence: true, on: :create
to theApplicationQualification
modelThings to check