{"size": 950, "ext": "js", "max_stars_repo_path": "server/test/api/auth.test.js", "max_stars_repo_name": "torinberger/note-app", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/test/api/auth.test.js", "max_issues_repo_name": "torinberger/note-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/test/api/auth.test.js", "max_forks_repo_name": "torinberger/note-app", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.619047619, "max_line_length": 57, "alphanum_fraction": 0.5094736842}
/* global describe */
/* global it */

const chai = require('chai');
const chaiHttp = require('chai-http');

const should = chai.should(); // eslint-disable-line
const SERVERURL = `http://localhost:${process.env.PORT}`;

chai.use(chaiHttp);

describe('Auth', () => {
  describe('Ping Auth API Without Auth', () => {
    it('it should respond with "pong"', (done) => {
      chai.request(SERVERURL)
        .get('/api/auth/ping')
        .end((err, res) => {
          res.should.have.status(200);
          res.text.should.contain('pong');
          done();
        });
    });
  });

  describe('Signup', () => {
    it('it should return status 201', (done) => {
      chai.request(SERVERURL)
        .post('/api/auth/signup')
        .send({
          username: 'test',
          password: 'test',
        })
        .end((err, res) => {
          res.should.have.status(201);
          done();
        });
    });
  });

  // TODO: test login
});
