Skip to content

Uc005 Delete Task

# specs/features/UC005-delete-task.feature
#
# SINGLE SOURCE OF TRUTH for UC005 behaviour.
# This file is:
#   (1) referenced by specs/use_cases/UC005-delete-task.md  (documentation)
#   (2) executed by the acceptance test suite               (living documentation)
#
# Rules:
#   - Scenario IDs (e.g. UC005-S01) must match the use case document.
#   - Step definitions live in: src/test/java/.../steps/
#   - Keep scenarios focused: one behaviour per scenario.
#   - Use exact terms from specs/glossary.md.

Feature: Delete Task
  As a User
  I want to delete a Task
  So that I can remove tasks I no longer need

  Background:
    Given a task exists with title "Fix login bug", status "TODO", and id stored as "existingTaskId"

  # ---------------------------------------------------------------------------
  # Happy path
  # ---------------------------------------------------------------------------

  Scenario: UC005-S01 Successfully delete an existing task
    When the User deletes the task with id "existingTaskId"
    Then the response status is 204
    And the task with id "existingTaskId" no longer exists in the system

  Scenario: UC005-S02 Deleted task no longer appears in the task list
    When the User deletes the task with id "existingTaskId"
    And the User requests the list of all tasks
    Then the response does not include a task with title "Fix login bug"

  # ---------------------------------------------------------------------------
  # Not found
  # ---------------------------------------------------------------------------

  Scenario: UC005-S03 Return 404 when deleting a non-existent task
    When the User deletes the task with id 999999
    Then the response status is 404
    And the response error code is "TASK_NOT_FOUND"