-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#165305268 User should be able to comment on an article #17
Conversation
(cherry picked from commit 6e2a2a1)
- ensure a user should be able to comment on an article - Write tests for the functionality [Delivers #165305268]
297a974
to
638dcbe
Compare
- ensure an authenticated user can comment on an article - write unit tests for the functionality [Delivers #165305278]
638dcbe
to
cf6e255
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 6e2a2a1)
- ensure a user should be able to comment on an article - Write tests for the functionality [Delivers #165305268]
09e52b1
to
b1e5690
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- ensure an authenticated user can comment on an article - write unit tests for the functionality [Delivers #165305278]
b1e5690
to
c9bbbe7
Compare
What does this PR do?
Implements commenting on an article endpoint
Description of Task(s) to be completed?
What are the relevant PT stories?
#165305278
How should this be manually tested?
$ git clone git@github.com:andela/ah-the-jedi-backend.git
$ cd ah-the-jedi-backend
$ git checkout ft-article-comment-165305268
$ python3 -m venv venv
$ source .venv/bin/activate
$ pip install -r api/requirements.txt
$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py runserver
Use postman to test the endpoints
$ git clone https://github.com/andela/ah-the-jedi-backend.git
POST
Create comment endpoint<you-local-host>/api/articles/{slug}/comments/
POST
Create comment on comment endpoint<you-local-host>/api/articles/{slug}/comments/?parent_id={parent_id}
Payload
{"comment": "I like this article"}
Comment on an article
![Screenshot 2019-05-02 at 13 07 40](https://user-images.githubusercontent.com/45317755/57068781-6040ae00-6cdb-11e9-953b-788f84bcef41.png)
Get Article payload
![Screenshot 2019-05-02 at 11 26 07](https://user-images.githubusercontent.com/45317755/57063986-aee74b80-6ccd-11e9-99a6-8b6cf621c684.png)
Commented comment payload
![Screenshot 2019-05-02 at 11 30 16](https://user-images.githubusercontent.com/45317755/57063991-b4449600-6ccd-11e9-9b26-838a5d70dcb1.png)
Comment on a comment. Threading
![Screenshot 2019-05-02 at 11 25 50](https://user-images.githubusercontent.com/45317755/57063959-97a85e00-6ccd-11e9-8382-05ce35f39f25.png)