diff --git a/app/javascript/new_registration/components/ChapterAmbassadorStepTwo.vue b/app/javascript/new_registration/components/ChapterAmbassadorStepTwo.vue index 79978288f..e9a736aa6 100644 --- a/app/javascript/new_registration/components/ChapterAmbassadorStepTwo.vue +++ b/app/javascript/new_registration/components/ChapterAmbassadorStepTwo.vue @@ -8,13 +8,13 @@
diff --git a/app/javascript/new_registration/components/JudgeStepTwo.vue b/app/javascript/new_registration/components/JudgeStepTwo.vue index 9047f7a7b..596954068 100644 --- a/app/javascript/new_registration/components/JudgeStepTwo.vue +++ b/app/javascript/new_registration/components/JudgeStepTwo.vue @@ -8,13 +8,13 @@
@@ -37,8 +37,8 @@ @keyup="checkValidation" @blur="checkValidation" />

- Your phone number will be shared with the Technovation Ambassador for your region and may be used to contact you - regarding volunteer opportunities. Providing your phone number is optional. + Your phone number will be shared with the Technovation Ambassador for your region and may be used to contact + you regarding volunteer opportunities. Providing your phone number is optional.

+ validation="required" :validation-messages="{ required: 'This field is required.' }" + @keyup="checkValidation" @blur="checkValidation" @input="checkValidation" /> diff --git a/app/javascript/new_registration/components/MentorStepTwo.vue b/app/javascript/new_registration/components/MentorStepTwo.vue index 617d17b5e..f07f988d8 100644 --- a/app/javascript/new_registration/components/MentorStepTwo.vue +++ b/app/javascript/new_registration/components/MentorStepTwo.vue @@ -8,13 +8,13 @@
@@ -35,8 +35,8 @@ @keyup="checkValidation" @blur="checkValidation" />

- Your phone number will be shared with the Technovation Ambassador for your region and may be used to contact you - regarding volunteer opportunities. Providing your phone number is optional. + Your phone number will be shared with the Technovation Ambassador for your region and may be used to contact + you regarding volunteer opportunities. Providing your phone number is optional.

+ validation="required" :validation-messages="{ required: 'This field is required.' }" + @keyup="checkValidation" @blur="checkValidation" @input="checkValidation" />
diff --git a/app/javascript/new_registration/components/StudentStepTwo.vue b/app/javascript/new_registration/components/StudentStepTwo.vue index 350c2c9d0..70d68df65 100644 --- a/app/javascript/new_registration/components/StudentStepTwo.vue +++ b/app/javascript/new_registration/components/StudentStepTwo.vue @@ -8,13 +8,13 @@
@@ -28,8 +28,8 @@

The cutoff date used for division assignment is {{ divisionCutoffDate }}. - Based on the birthday you entered, {{ pronoun }} will be {{ ageByDivisionCutoff }} years old - by this date. + Based on the birthday you entered, {{ pronoun }} will be {{ ageByDivisionCutoff }} years + old by this date.

diff --git a/app/models/account.rb b/app/models/account.rb index f0c7c5700..2bdffede3 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -548,7 +548,7 @@ def chapter_ambassador validates :first_name, :last_name, presence: true, - format: {with: /[A-Za-z]/, message: "must contain at least one alphabetical character"} + format: {with: /\A[^.-].*/, message: "must start with an alphabetical character"} validates :date_of_birth, presence: true, if: -> { !is_a_judge? && !is_chapter_ambassador? } validates :meets_minimum_age_requirement, inclusion: [true], if: -> { (is_a_judge? || is_chapter_ambassador?) && new_record? } diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index b961ee709..0472df828 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -142,6 +142,16 @@ end end + context "when the first name contains a special character not at the beginning" do + before do + judge.first_name = "Billie-Jean" + end + + it "is valid" do + expect(judge).to be_valid + end + end + describe "#last_name" do let(:judge) { FactoryBot.create(:judge) } @@ -164,6 +174,16 @@ expect(judge).not_to be_valid end end + + context "when the last name contains a special character not at the beginning" do + before do + judge.last_name = "A." + end + + it "is valid" do + expect(judge).to be_valid + end + end end end