Skip to content

Commit

Permalink
resolving status code and other minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramachandrangunasekaran committed Jun 19, 2019
1 parent 1eac7f5 commit 6183075
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Expand Up @@ -8,6 +8,8 @@ package-lock.json

# Webstorm/text editor meta
.idea/
# VSCode meta folder
.vscode

# Distribution
dist/
Expand All @@ -19,10 +21,6 @@ dist/
# tern
.tern-port

# VSCode meta folder
.vscode


#coverage
.nyc_output
coverage
Expand Down
2 changes: 1 addition & 1 deletion app/routes/user-routes.js
Expand Up @@ -26,7 +26,7 @@ function signUp(req, res) {

emailController.sendWelcomeEmail(user.email, verificationHash);

return res.status(201).send({
return res.status(200).send({
msg: 'User created successfully!',
token: jwtController.generateToken({
userId: user._id
Expand Down
4 changes: 2 additions & 2 deletions test.js
@@ -1,5 +1,5 @@
/**
* Created by sridharrajs.
* Created by ramachandrang.
*/

'use strict';
Expand All @@ -16,7 +16,7 @@ class TestFactory extends CF {
static init() {
if (dotenv.error) {
console.trace(chalk.red('.env.test file is missing'));
return Promise.reject('.env.test file is missing')
return Promise.reject('.env.test file is missing');
}

return config.isValidEnv(process.env.NODE_ENV).then(info => {
Expand Down
4 changes: 2 additions & 2 deletions test/api/auth/user.js
Expand Up @@ -14,12 +14,12 @@ describe('*****USER AUTHENTICATION AND AUTHORIZATION*****', () => {

//Success Case.

it('Happy Case(201), Create a User.', (done) => {
it('Happy Case(200), Create a User.', (done) => {
request(app).post('/users/signup')
.send({ email: 'foo@bar.com', password: "foobar123" })
.then((res) => {
const { body, status } = res;
expect(status).to.equal(201);
expect(status).to.equal(200);
expect(body).to.contain.property('token');
done();
})
Expand Down

0 comments on commit 6183075

Please sign in to comment.