Skip to content

Commit

Permalink
Tweak test with special char
Browse files Browse the repository at this point in the history
  • Loading branch information
flovilmart committed Mar 13, 2016
1 parent 2557ea6 commit ccc19ad
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions spec/ValidationAndPasswordsReset.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ describe("Custom Pages Configuration", () => {
},
publicServerURL: "https://my.public.server.com/1"
});

var config = new Config("test");

expect(config.invalidLinkURL).toEqual("myInvalidLink");
expect(config.verifyEmailSuccessURL).toEqual("myVerifyEmailSuccess");
expect(config.choosePasswordURL).toEqual("myChoosePassword");
Expand Down Expand Up @@ -78,7 +78,7 @@ describe("Email Verification", () => {
}
});
});

it('does not send verification email when verification is enabled and email is not set', done => {
var emailAdapter = {
sendVerificationEmail: () => Promise.resolve(),
Expand Down Expand Up @@ -119,7 +119,7 @@ describe("Email Verification", () => {
}
});
});

it('does send a validation email when updating the email', done => {
var emailAdapter = {
sendVerificationEmail: () => Promise.resolve(),
Expand Down Expand Up @@ -169,7 +169,7 @@ describe("Email Verification", () => {
}
});
});

it('does send with a simple adapter', done => {
var calls = 0;
var emailAdapter = {
Expand Down Expand Up @@ -311,7 +311,7 @@ describe("Email Verification", () => {
followRedirect: false,
}, (error, response, body) => {
expect(response.statusCode).toEqual(302);
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=zxcv');
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=user%2Bworld');
user.fetch()
.then(() => {
expect(user.get('emailVerified')).toEqual(true);
Expand Down Expand Up @@ -342,7 +342,7 @@ describe("Email Verification", () => {
publicServerURL: "http://localhost:8378/1"
});
user.setPassword("asdf");
user.setUsername("zxcv");
user.setUsername("hello+world");
user.set('email', 'user@parse.com');
user.signUp();
});
Expand Down Expand Up @@ -453,7 +453,7 @@ describe("Email Verification", () => {
});

describe("Password Reset", () => {

it('should send a password reset link', done => {
var user = new Parse.User();
var emailAdapter = {
Expand Down Expand Up @@ -503,7 +503,7 @@ describe("Password Reset", () => {
});
});
});

it('redirects you to invalid link if you try to request password for a nonexistant users email', done => {
setServerConfiguration({
serverURL: 'http://localhost:8378/1',
Expand Down Expand Up @@ -555,8 +555,8 @@ describe("Password Reset", () => {
return;
}
var token = match[1];
request.post({

request.post({
url: "http://localhost:8378/1/apps/test/request_password_reset" ,
body: `new_password=hello&token=${token}&username=zxcv`,
headers: {
Expand All @@ -571,15 +571,15 @@ describe("Password Reset", () => {
}
expect(response.statusCode).toEqual(302);
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html');

Parse.User.logIn("zxcv", "hello").then(function(user){
done();
}, (err) => {
console.error(err);
fail("should login with new password");
done();
});

});
});
},
Expand Down Expand Up @@ -613,6 +613,5 @@ describe("Password Reset", () => {
});
});
});

})

})

0 comments on commit ccc19ad

Please sign in to comment.