-
Notifications
You must be signed in to change notification settings - Fork 21
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
Review work history gaps #7347
base: main
Are you sure you want to change the base?
Review work history gaps #7347
Conversation
7d9cee7
to
25864a1
Compare
25864a1
to
6786a8f
Compare
Review app deployed to https://teaching-vacancies-review-pr-7347.test.teacherservices.cloud on AKS |
attributes[:unexplained_employment_gaps] = job_application.unexplained_employment_gaps if step == :employment_history | ||
|
||
if step == :professional_status | ||
attributes.merge(jobseeker_profile_attributes) | ||
.merge(trn_params) | ||
else | ||
attributes | ||
attributes.merge!(jobseeker_profile_attributes) | ||
.merge!(trn_params) | ||
end | ||
|
||
attributes |
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.
IMHO it's bad practice for a function to modify its input parameters, hence the original non-destructive version
@@ -1,21 +1,25 @@ | |||
class Jobseekers::JobApplication::EmploymentHistoryForm < Jobseekers::JobApplication::BaseForm | |||
include ActiveModel::Model | |||
include ActionView::Helpers::DateHelper |
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 feels like view code in the model layer. It would be more idiomatic to add an error which is then rendered later?
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 need access to distance_of_time_in_words
; hence, I need to add this here. Also, consider this is a form model.
|
||
context "when employment history gaps are present" do | ||
it "adds errors for each unexplained gap" do | ||
form.valid? |
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.
the idiom here to to assert that the form isn't valid, which then allows the errors to be asserted afterwards rather than this hanging valid? call
let(:unexplained_employment_gaps_present) { "false" } | ||
|
||
it "does not add errors for gaps" do | ||
form.valid? |
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.
expect(form).to be_valid
Trello card URL
https://trello.com/c/EoVximLZ/1436-review-work-history-gaps-and-link-error-messaging-to-each-gap
Changes in this PR:
Split error messages in the working history gaps page.
Screenshots of UI changes:
Before
After