Skip to content
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

Merged
merged 6 commits into from
May 2, 2019

Conversation

AlvinMugambi
Copy link
Contributor

@AlvinMugambi AlvinMugambi commented May 2, 2019

What does this PR do?

Implements commenting on an article endpoint

Description of Task(s) to be completed?

  • A user should be able to comment on articles and read/access comments created by other users.
  • Timestamped comments
  • Threaded comments

What are the relevant PT stories?

#165305278

How should this be manually tested?

  • Clone this repository on local machine and CD into project folder

$ git clone git@github.com:andela/ah-the-jedi-backend.git

$ cd ah-the-jedi-backend

  • Check out to the PR's branch

$ git checkout ft-article-comment-165305268

  • Create and activate virtual environment

$ python3 -m venv venv

$ source .venv/bin/activate

  • Install app dependencies from requirements.txt

$ pip install -r api/requirements.txt

  • Make migrations and run the server

$ python manage.py makemigrations

$ python manage.py migrate

$ python manage.py runserver

Use postman to test the endpoints

  • Sign up a user

$ git clone https://github.com/andela/ah-the-jedi-backend.git

  • Test the endpoints

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

Get Article payload
Screenshot 2019-05-02 at 11 26 07

Commented comment payload
Screenshot 2019-05-02 at 11 30 16

Comment on a comment. Threading
Screenshot 2019-05-02 at 11 25 50

ElishaMisoi and others added 2 commits May 2, 2019 11:45
- ensure a user should be able to comment on an article
- Write tests for the functionality
[Delivers #165305268]
@AlvinMugambi AlvinMugambi force-pushed the ft-article-comment-165305268 branch from 297a974 to 638dcbe Compare May 2, 2019 08:51
@AlvinMugambi AlvinMugambi changed the title Ft article comment 165305268 #165305268 User should be able to comment on an article May 2, 2019
- ensure an authenticated user can comment on an article
- write unit tests for the functionality
[Delivers #165305278]
Copy link
Contributor

@ElishaMisoi ElishaMisoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@Benkimeric Benkimeric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ElishaMisoi ElishaMisoi temporarily deployed to ah-the-jedi-backend-staging May 2, 2019 10:50 Inactive
ElishaMisoi and others added 2 commits May 2, 2019 15:04
- ensure a user should be able to comment on an article
- Write tests for the functionality
[Delivers #165305268]
@katherine95 katherine95 temporarily deployed to ah-the-jedi-backend-staging May 2, 2019 12:40 Inactive
@AlvinMugambi AlvinMugambi force-pushed the ft-article-comment-165305268 branch 5 times, most recently from 09e52b1 to b1e5690 Compare May 2, 2019 13:11
@ElishaMisoi ElishaMisoi temporarily deployed to ah-the-jedi-backend-staging May 2, 2019 13:48 Inactive
Copy link
Contributor

@Siffersari Siffersari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@jkamz jkamz left a 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]
@AlvinMugambi AlvinMugambi force-pushed the ft-article-comment-165305268 branch from b1e5690 to c9bbbe7 Compare May 2, 2019 15:29
@ElishaMisoi ElishaMisoi temporarily deployed to ah-the-jedi-backend-staging May 2, 2019 15:29 Inactive
@rnjane rnjane merged commit b78b22a into develop May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants