This file contains hidden or 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
import chai from 'chai'; | |
import chaiHttp from 'chai-http'; | |
import { server } from '../index'; // Server is defined in the api entry point (index.js) | |
const expect = chai.expect; | |
chai.use(chaiHttp); | |
describe('When a User sends a GET get Request to /api/profiles/:username', () => { | |
it('it should return the profile of the user with the provided username', (done) => { | |
chai.request(server) |
This file contains hidden or 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
import models from '../models'; | |
const { Article, Rating } = models; | |
/** | |
* This class contains all the methods responsible for rating | |
* articles on the app | |
* It is made up static methods which can be called from anywhere in the app. | |
*/ | |
export default class articleRatingController { | |
/** |