@@ -56,6 +56,7 @@ describe("Email Verification", () => {
5656 fileKey : 'test' ,
5757 verifyUserEmails : true ,
5858 emailAdapter : emailAdapter ,
59+ publicServerURL : "http://localhost:8378/1"
5960 } ) ;
6061 spyOn ( emailAdapter , 'sendVerificationEmail' ) ;
6162 var user = new Parse . User ( ) ;
@@ -97,6 +98,7 @@ describe("Email Verification", () => {
9798 fileKey : 'test' ,
9899 verifyUserEmails : true ,
99100 emailAdapter : emailAdapter ,
101+ publicServerURL : "http://localhost:8378/1"
100102 } ) ;
101103 spyOn ( emailAdapter , 'sendVerificationEmail' ) ;
102104 var user = new Parse . User ( ) ;
@@ -137,6 +139,7 @@ describe("Email Verification", () => {
137139 fileKey : 'test' ,
138140 verifyUserEmails : true ,
139141 emailAdapter : emailAdapter ,
142+ publicServerURL : "http://localhost:8378/1"
140143 } ) ;
141144 spyOn ( emailAdapter , 'sendVerificationEmail' ) ;
142145 var user = new Parse . User ( ) ;
@@ -196,6 +199,7 @@ describe("Email Verification", () => {
196199 fileKey : 'test' ,
197200 verifyUserEmails : true ,
198201 emailAdapter : emailAdapter ,
202+ publicServerURL : "http://localhost:8378/1"
199203 } ) ;
200204 var user = new Parse . User ( ) ;
201205 user . setPassword ( "asdf" ) ;
@@ -284,6 +288,7 @@ describe("Email Verification", () => {
284288 fileKey : 'test' ,
285289 verifyUserEmails : true ,
286290 emailAdapter : emailAdapter ,
291+ publicServerURL : "http://localhost:8378/1"
287292 } ) ;
288293 var user = new Parse . User ( ) ;
289294 user . setPassword ( "asdf" ) ;
@@ -334,6 +339,7 @@ describe("Email Verification", () => {
334339 fileKey : 'test' ,
335340 verifyUserEmails : true ,
336341 emailAdapter : emailAdapter ,
342+ publicServerURL : "http://localhost:8378/1"
337343 } ) ;
338344 user . setPassword ( "asdf" ) ;
339345 user . setUsername ( "zxcv" ) ;
@@ -342,6 +348,25 @@ describe("Email Verification", () => {
342348 } ) ;
343349
344350 it ( 'redirects you to invalid link if you try to verify email incorrecly' , done => {
351+ setServerConfiguration ( {
352+ serverURL : 'http://localhost:8378/1' ,
353+ appId : 'test' ,
354+ appName : 'emailing app' ,
355+ javascriptKey : 'test' ,
356+ dotNetKey : 'windows' ,
357+ clientKey : 'client' ,
358+ restAPIKey : 'rest' ,
359+ masterKey : 'test' ,
360+ collectionPrefix : 'test_' ,
361+ fileKey : 'test' ,
362+ verifyUserEmails : true ,
363+ emailAdapter : {
364+ sendVerificationEmail : ( ) => Promise . resolve ( ) ,
365+ sendPasswordResetEmail : ( ) => Promise . resolve ( ) ,
366+ sendMail : ( ) => { }
367+ } ,
368+ publicServerURL : "http://localhost:8378/1"
369+ } ) ;
345370 request . get ( 'http://localhost:8378/1/apps/test/verify_email' , {
346371 followRedirect : false ,
347372 } , ( error , response , body ) => {
@@ -352,6 +377,25 @@ describe("Email Verification", () => {
352377 } ) ;
353378
354379 it ( 'redirects you to invalid link if you try to validate a nonexistant users email' , done => {
380+ setServerConfiguration ( {
381+ serverURL : 'http://localhost:8378/1' ,
382+ appId : 'test' ,
383+ appName : 'emailing app' ,
384+ javascriptKey : 'test' ,
385+ dotNetKey : 'windows' ,
386+ clientKey : 'client' ,
387+ restAPIKey : 'rest' ,
388+ masterKey : 'test' ,
389+ collectionPrefix : 'test_' ,
390+ fileKey : 'test' ,
391+ verifyUserEmails : true ,
392+ emailAdapter : {
393+ sendVerificationEmail : ( ) => Promise . resolve ( ) ,
394+ sendPasswordResetEmail : ( ) => Promise . resolve ( ) ,
395+ sendMail : ( ) => { }
396+ } ,
397+ publicServerURL : "http://localhost:8378/1"
398+ } ) ;
355399 request . get ( 'http://localhost:8378/1/apps/test/verify_email?token=asdfasdf&username=sadfasga' , {
356400 followRedirect : false ,
357401 } , ( error , response , body ) => {
@@ -393,6 +437,7 @@ describe("Email Verification", () => {
393437 fileKey : 'test' ,
394438 verifyUserEmails : true ,
395439 emailAdapter : emailAdapter ,
440+ publicServerURL : "http://localhost:8378/1"
396441 } ) ;
397442 user . setPassword ( "asdf" ) ;
398443 user . setUsername ( "zxcv" ) ;
@@ -443,6 +488,7 @@ describe("Password Reset", () => {
443488 fileKey : 'test' ,
444489 verifyUserEmails : true ,
445490 emailAdapter : emailAdapter ,
491+ publicServerURL : "http://localhost:8378/1"
446492 } ) ;
447493 user . setPassword ( "asdf" ) ;
448494 user . setUsername ( "zxcv" ) ;
@@ -459,6 +505,25 @@ describe("Password Reset", () => {
459505 } ) ;
460506
461507 it ( 'redirects you to invalid link if you try to request password for a nonexistant users email' , done => {
508+ setServerConfiguration ( {
509+ serverURL : 'http://localhost:8378/1' ,
510+ appId : 'test' ,
511+ appName : 'emailing app' ,
512+ javascriptKey : 'test' ,
513+ dotNetKey : 'windows' ,
514+ clientKey : 'client' ,
515+ restAPIKey : 'rest' ,
516+ masterKey : 'test' ,
517+ collectionPrefix : 'test_' ,
518+ fileKey : 'test' ,
519+ verifyUserEmails : true ,
520+ emailAdapter : {
521+ sendVerificationEmail : ( ) => Promise . resolve ( ) ,
522+ sendPasswordResetEmail : ( ) => Promise . resolve ( ) ,
523+ sendMail : ( ) => { }
524+ } ,
525+ publicServerURL : "http://localhost:8378/1"
526+ } ) ;
462527 request . get ( 'http://localhost:8378/1/apps/test/request_password_reset?token=asdfasdf&username=sadfasga' , {
463528 followRedirect : false ,
464529 } , ( error , response , body ) => {
@@ -533,6 +598,7 @@ describe("Password Reset", () => {
533598 fileKey : 'test' ,
534599 verifyUserEmails : true ,
535600 emailAdapter : emailAdapter ,
601+ publicServerURL : "http://localhost:8378/1"
536602 } ) ;
537603 user . setPassword ( "asdf" ) ;
538604 user . setUsername ( "zxcv" ) ;
0 commit comments