Skip to content

Commit

Permalink
Update test and swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
henperi committed Jan 9, 2019
1 parent 4b5079c commit 762372f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion routes/highlights.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { checkHighlightUpdate, checkHighlightCreate } from '../middlewares/highl
const router = express.Router();

router.post(
'/:articleId/highlight',
'/:articleId/highlights',
checkAuthentication,
checkArticle,
checkHighlightCreate,
Expand Down
8 changes: 4 additions & 4 deletions test/highlights.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ chai.use(chaiHttp);
chai.should();

describe('Test For HighLights', () => {
describe('POST /api/v1/articles/:articleId/highlight', () => {
describe('POST /api/v1/articles/:articleId/highlights', () => {
it('should return 400 when the highlighted text is undefined', async () => {
const data = {
highlightedText: undefined
};
const res = await chai
.request(app)
.post(`/api/v1/articles/${bodyHelper.article.id}/highlight`)
.post(`/api/v1/articles/${bodyHelper.article.id}/highlights`)
.send(data)
.set('access-token', bodyHelper.userToken);
res.status.should.equal(400);
Expand All @@ -34,7 +34,7 @@ describe('Test For HighLights', () => {
};
const res = await chai
.request(app)
.post(`/api/v1/articles/${bodyHelper.article.id}/highlight`)
.post(`/api/v1/articles/${bodyHelper.article.id}/highlights`)
.send(data)
.set('access-token', bodyHelper.userToken);

Expand All @@ -50,7 +50,7 @@ describe('Test For HighLights', () => {
};
const res = await chai
.request(app)
.post(`/api/v1/articles/${bodyHelper.article.id}/highlight`)
.post(`/api/v1/articles/${bodyHelper.article.id}/highlights`)
.send(data)
.set('access-token', bodyHelper.userToken);

Expand Down

0 comments on commit 762372f

Please sign in to comment.