-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Add a reviews field to User model. A list of PerformanceReview
PerformanceReview model should contain the following fields:
author(required) - The user who asks for a performance reviewadmins(required) - A list ofADMINusers that can reply to the reviewdescription(required) - The user's explanation regarding why their performance should be reviewed
PerformanceReview controller should include the following methods:
create(Regular users only)update(Only the user that created the review)delete(Only the user that created the review)list(ADMINcan only list reviews which he belongs to the admins list. Regular users can only list reviews created by themselves)show(ADMINcan only view reviews which he belongs to the admins list. Regular users can only view reviews created by themselves)reply(ADMINcan only reply to reviews which he belongs to the admins list. Regular users can only reply to reviews created by themselves)
Suggested tests:
- Create review using an
ADMINuser (should return 401 - Unauthorized) - Create review using a user from any other level (should return 201 - Created)
- Update review using the user that created it (should return 200 - OK)
- Update review using a user that hasn't created it (should return 401 - Unauthorized)
- Delete review using the user that created it (should return 200 - OK)
- Delete review using a user that hasn't created it (should return 401 - Unauthorized)
- List all reviews using an
ADMINuser (should return 200 - OK, displaying only the reviews that has thisADMINon theadminslist) - List all reviews using a user from any other level (should return 200 - OK, displaying only the reviews created by them)
- View a review using the user that created it (should return 200 - OK)
- View a review using a regular user that hasn't created it (should return 401 - Unauthorized)
- View a review using an
ADMINuser that is not on theadminslist of the review (should return 401 - Unauthorized) - View a review using an
ADMINuser that is on theadminslist of the review (should return 200 - OK) - Create/Update review without required fields