-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update ECTAtSchoolPeriod and MentorAtSchoolPeriod models to han…
…dle 'email'. Add email formatting validation
- Loading branch information
Showing
4 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,12 @@ | |
it { is_expected.to validate_presence_of(:school_id) } | ||
it { is_expected.to validate_presence_of(:teacher_id) } | ||
|
||
context "email" do | ||
it { is_expected.to allow_value(nil).for(:email) } | ||
it { is_expected.to allow_value("[email protected]").for(:email) } | ||
it { is_expected.not_to allow_value("invalid_email").for(:email) } | ||
end | ||
|
||
context "teacher distinct period" do | ||
context "when the period has not finished yet" do | ||
context "when the teacher has a sibling ect_at_school_period starting later" do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,12 @@ | |
it { is_expected.to validate_presence_of(:school_id) } | ||
it { is_expected.to validate_presence_of(:teacher_id) } | ||
|
||
context "email" do | ||
it { is_expected.to allow_value(nil).for(:email) } | ||
it { is_expected.to allow_value("[email protected]").for(:email) } | ||
it { is_expected.not_to allow_value("invalid_email").for(:email) } | ||
end | ||
|
||
context "teacher school distinct period" do | ||
context "when the period has not finished yet" do | ||
context "when the teacher has a school sibling mentor_at_school_period starting later" do | ||
|