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

#161255359 Users should be able to rate an article #22

Merged
merged 32 commits into from
Nov 9, 2018

Conversation

maxwellgithinji
Copy link
Contributor

What does this PR do?

  • Enable an authenticated user to rate an article
  • Enable users to get an average rating for their article

Description of Task to be completed?

  • Create a functionality to allow only authenticated users to rate their article
  • Create functionality to allow users to view average rating for their article

How should this be manually tested?

Rating an article
  1. Clone the repo and check out ft-rate-article-161255359 branch
  2. setup the database
  3. set up the virtual environment
  4. Register and Login to the application and add the token to Auth header
  5. Create an article
  6. Login and register with different credentials and add the token to Auth header
  7. Run the /api/articles/<str: slug>/rate/ endpoint with JSON data ,e.g. {"rate": <int>} using POST
Viewing average rating of an article
  1. Run the /api/articles/<str: slug>/ endpoint using GET

Any background context you want to provide?

  • Implementing rating will help the best articles according to users stand out

What are the relevant pivotal tracker stories?

  • Users should be able to rate an article- #161255359

Screenshots

Rate an article

screen shot 2018-11-08 at 11 49 20

Get average rating

screen shot 2018-11-08 at 11 50 19

Questions

KE-C02QF4HNFVH3 and others added 15 commits November 5, 2018 10:48
- Add new folder in apps articles/
[Feature #161255358]
- Add new folder in apps articles/
[Feature #161255358]
- Add new folder in apps articles/
[Feature #161255358]
- Add new folder in apps articles/
[Feature #161255358]
- Add models for articles
- Add seriaizers for articles
- Add views for articles
- Add url routes for articles
[Feature #161255358]
- User can create an article
- User can fetch all articles
- User can fetch a single article
- User can update their article
- User can delete their article
- Add tests for all the CRUD functions
[Feature #161255358]
- Add new folder in apps articles/
[Feature #161255358]
- Add new folder in apps articles/
[Feature #161255358]
- Add models for articles
- Add seriaizers for articles
- Add views for articles
- Add url routes for articles
[Feature #161255358]
- User can create an article
- User can fetch all articles
- User can fetch a single article
- User can update their article
- User can delete their article
- Add tests for all the CRUD functions
[Feature #161255358]
- Rebase from develop and merge conflicts
[Feature #161255358]
- Merge conflicts from origin
[Feature #161255358]
- Merge conflicts from origin
[Feature #161255358]
- ensure Only authenticated users should be able to provide ratings
- ensure Users should get an average rating for their articles
[Feature #161255359]
@maxwellgithinji maxwellgithinji changed the title 161255359 Ft rate article 161255359 Users should be able to rate an article Nov 8, 2018
- ensure user rating works correctly
[Feature #161255359]
@coveralls
Copy link

coveralls commented Nov 8, 2018

Pull Request Test Coverage Report for Build 218

  • 215 of 221 (97.29%) changed or added relevant lines in 12 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.8%) to 94.146%

Changes Missing Coverage Covered Lines Changed/Added Lines %
authors/apps/rating/models.py 8 9 88.89%
authors/apps/articles/serializers.py 14 16 87.5%
authors/apps/rating/serializers.py 39 42 92.86%
Totals Coverage Status
Change from base Build 200: 0.8%
Covered Lines: 965
Relevant Lines: 1025

💛 - Coveralls

@maxwellgithinji maxwellgithinji changed the title 161255359 Users should be able to rate an article #161255359 Users should be able to rate an article Nov 8, 2018
KE-C02QF4HNFVH3 added 8 commits November 8, 2018 19:47
- Add new folder in apps articles/
[Feature #161255358]
- Add new folder in apps articles/
[Feature #161255358]
- Add models for articles
- Add seriaizers for articles
- Add views for articles
- Add url routes for articles
[Feature #161255358]
- User can create an article
- User can fetch all articles
- User can fetch a single article
- User can update their article
- User can delete their article
- Add tests for all the CRUD functions
[Feature #161255358]
- Add new folder in apps articles/
[Feature #161255358]
- Add models for articles
- Add seriaizers for articles
- Add views for articles
- Add url routes for articles
[Feature #161255358]
- User can create an article
- User can fetch all articles
- User can fetch a single article
- User can update their article
- User can delete their article
- Add tests for all the CRUD functions
[Feature #161255358]
- Rebase from develop and merge conflicts
[Feature #161255358]
- ensure Only authenticated users should be able to provide ratings
- ensure Users should get an average rating for their articles
[Feature #161255359]
- ensure user rating works correctly
[Feature #161255359]
@maxwellgithinji maxwellgithinji force-pushed the ft-rate-article-161255359 branch 2 times, most recently from ddcbb10 to 0fa67bc Compare November 9, 2018 05:46
- ensure the PR is up to date with develop and any other open PR's in order to prepare the brach for merging
[Feature #161255359]
Copy link
Contributor

@AnguleMathias AnguleMathias 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 redendant code is fixed
[Feature #161255359]
Copy link
Contributor

@3N61N33R 3N61N33R left a comment

Choose a reason for hiding this comment

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

LG

@meshnesh meshnesh merged commit 7b74852 into develop Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants