Tweak test with special char
This commit is contained in:
@@ -311,7 +311,7 @@ describe("Email Verification", () => {
|
|||||||
followRedirect: false,
|
followRedirect: false,
|
||||||
}, (error, response, body) => {
|
}, (error, response, body) => {
|
||||||
expect(response.statusCode).toEqual(302);
|
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');
|
||||||
user.fetch()
|
user.fetch()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(user.get('emailVerified')).toEqual(true);
|
expect(user.get('emailVerified')).toEqual(true);
|
||||||
@@ -342,7 +342,7 @@ describe("Email Verification", () => {
|
|||||||
publicServerURL: "http://localhost:8378/1"
|
publicServerURL: "http://localhost:8378/1"
|
||||||
});
|
});
|
||||||
user.setPassword("asdf");
|
user.setPassword("asdf");
|
||||||
user.setUsername("zxcv");
|
user.setUsername("user");
|
||||||
user.set('email', 'user@parse.com');
|
user.set('email', 'user@parse.com');
|
||||||
user.signUp();
|
user.signUp();
|
||||||
});
|
});
|
||||||
@@ -468,7 +468,7 @@ describe("Password Reset", () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
expect(response.statusCode).toEqual(302);
|
expect(response.statusCode).toEqual(302);
|
||||||
var re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=zxcv/;
|
var re = /http:\/\/localhost:8378\/1\/apps\/choose_password\?token=[a-zA-Z0-9]+\&id=test\&username=zxcv%2Bzxcv/;
|
||||||
expect(response.body.match(re)).not.toBe(null);
|
expect(response.body.match(re)).not.toBe(null);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@@ -491,7 +491,7 @@ describe("Password Reset", () => {
|
|||||||
publicServerURL: "http://localhost:8378/1"
|
publicServerURL: "http://localhost:8378/1"
|
||||||
});
|
});
|
||||||
user.setPassword("asdf");
|
user.setPassword("asdf");
|
||||||
user.setUsername("zxcv");
|
user.setUsername("zxcv+zxcv");
|
||||||
user.set('email', 'user@parse.com');
|
user.set('email', 'user@parse.com');
|
||||||
user.signUp().then(() => {
|
user.signUp().then(() => {
|
||||||
Parse.User.requestPasswordReset('user@parse.com', {
|
Parse.User.requestPasswordReset('user@parse.com', {
|
||||||
@@ -615,4 +615,3 @@ describe("Password Reset", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -176,11 +176,13 @@ function makeExpressHandler(promiseHandler) {
|
|||||||
return res.send(result.text);
|
return res.send(result.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.location && !result.response) {
|
|
||||||
return res.redirect(result.location);
|
|
||||||
}
|
|
||||||
if (result.location) {
|
if (result.location) {
|
||||||
res.set('Location', result.location);
|
res.set('Location', result.location);
|
||||||
|
// Override the default expressjs response
|
||||||
|
// as it double encodes %encoded chars in URL
|
||||||
|
if (!result.response) {
|
||||||
|
return res.send('Found. Redirecting to '+result.location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
res.json(result.response);
|
res.json(result.response);
|
||||||
}, (e) => {
|
}, (e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user