sambuite / challenge-middlewares

A educational challenge to make additions and changes in order to make the tests pass.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Requirements

Users

  • Should be able to create a new user
  • Should not be able to create a new user when username already exists
  • Should be able to show user data

Todos

  • Should be able to list all user's todo
  • Should be able to create a new todo
  • Should be able to update a todo
  • Should not be able to update a non existing todo
  • Should be able to mark a todo as done
  • Should not be able to mark a non existing todo as done
  • Should be able to delete a todo
  • Should not be able to delete a non existing todo

findUserById

  • Should be able to find user by id route param and pass it to request.user
  • Should not be able to pass user to request.user when it does not exists

checksTodoExists

  • Should be able to put user and todo in request when both exits
  • Should not be able to put user and todo in request when user does not exists
  • Should not be able to put user and todo in request when todo id is not uuid
  • Should not be able to put user and todo in request when todo does not exists

checksExistsUserAccount

  • Should be able to find user by username in header and pass it to request.user
  • Should not be able to find a non existing user by username in header

checksCreateTodosUserAvailability

  • Should be able to let user create a new todo when is in free plan and have less than ten todos
  • Should not be able to let user create a new todo when is not Pro and already have ten todos
  • Should be able to let user create infinite new todos when is in Pro plan

About

A educational challenge to make additions and changes in order to make the tests pass.


Languages

Language:JavaScript 100.0%