laravel-portugal/api

An authenticated user can update a question

Closed this issue · 2 comments

Scenario

Given I'm an authenticated user of any type
When I send a PATCH request to /questions/{questionId} with the updatable input and the question was created by me
I expect that question to be updated

Given I'm an authenticated user of any type
When I send a PATCH request to /questions/{questionId} with the updatable input and the question was not created by me
I expect to not be able to update that question

Updatable input

  • title: the title of the question. Must be filled.
  • slug: the URL friendly identifier, automatically generated based on the title. Must be unique.
  • description: the question itself.
  • updated_at: timestamp with timezone. Must be automatically updated with the current timestamp of the update action.

Additional requirements

This builds on the features of #25.

@josepostiga I'll take this one if that's ok...

PR #41