-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(logout):add user logout router
- Loading branch information
1 parent
525211b
commit 8ebc81d
Showing
6 changed files
with
77 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { respondWithSuccess } from '../helpers/responseHandler'; | ||
|
||
|
||
/** | ||
* Creates a new user | ||
* @param {Object} req | ||
* @param {Object} res | ||
* @returns {Function} CreateUser | ||
*/ | ||
|
||
const logout = (req, res) => respondWithSuccess(res, 200, 'Successfully Logged out'); | ||
|
||
export default logout; |
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
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import chai from 'chai'; | ||
import chaiHttp from 'chai-http'; | ||
import app from '../index'; | ||
|
||
const { expect } = chai; | ||
chai.use(chaiHttp); | ||
|
||
const logoutUrl = '/api/v1/auth/logout'; | ||
|
||
describe('USER CONTROLLER', () => { | ||
describe('GET LOG OUT', () => { | ||
it('it should logout a user with a response indication successful logout', done => { | ||
chai | ||
.request(app) | ||
.get(logoutUrl) | ||
.end((error, res) => { | ||
expect(res).to.have.status(200); | ||
expect(res.body.message).to.be.equal('Successfully Logged out'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |