generated from navikt/crm-shared-template
-
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.
Merge pull request #350 from navikt/TOLK-2358
TOLK-2358 Ikke lenger mulig å melde på flere på samme e-postadresse
- Loading branch information
Showing
2 changed files
with
26 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,18 +25,28 @@ private with sharing class CourseRegistrationControllerTest { | |
wrapper.email = '[email protected]'; | ||
wrapper.companyNumber = '677777'; | ||
wrapper.source = 'Kurs'; | ||
|
||
String fields = JSON.serialize(wrapper); | ||
|
||
CourseRegistrationModel wrapperDuplicate = new CourseRegistrationModel(); | ||
wrapperDuplicate.firstName = 'test2'; | ||
wrapperDuplicate.lastName = 'etternavn2'; | ||
wrapperDuplicate.phone = '90080902'; | ||
wrapperDuplicate.email = '[email protected]'; | ||
wrapperDuplicate.companyNumber = '677777'; | ||
wrapperDuplicate.source = 'Kurs'; | ||
String fieldsOnDuplicate = JSON.serialize(wrapperDuplicate); | ||
|
||
Test.StartTest(); | ||
String result = CourseRegistrationController.createRegistration(fields, courseId); | ||
String resultOfInitialReg = CourseRegistrationController.createRegistration(fields, courseId); | ||
String result2 = CourseRegistrationController.createRegistration(fields, noCourseId); | ||
String resultOfDuplicateReg = CourseRegistrationController.createRegistration(fieldsOnDuplicate, courseId); | ||
Test.StopTest(); | ||
System.assertEquals( | ||
'Påmelding vellykket. Du vil om kort tid motta en bekreftelse på e-post', | ||
result, | ||
resultOfInitialReg, | ||
'Registration successfull' | ||
); | ||
System.assertEquals('Det oppsto en feil. Prøv igjen senere.', result2, 'Course id missing'); | ||
System.assertEquals('Du er allerede påmeldt dette kurset, vennligst bruk en annen e-postadresse.', resultOfDuplicateReg, 'Duplicate registration'); | ||
} | ||
} |