Open andreiursan opened 12 years ago
Added tests for categories:
Conclusion - if you delete a parent category - all its children will cascade deleted
Scenario: Manage categories
Given the following categories
|name |description |parent_id|
|Food |Main category for food |0 |
|Fast food |Fast food subcategory for food |1 |
|Shawormas |Shawormas om nom nom |2 |
|Healthy food|Healthy food subcategory for food|1 |
|Clothes |Main category for clothes |0 |
|Pants |Put your pants here |5 |
|Shoes |Gimme the shoes |5 |
When I create them through the REST API
Then I should be able to list their names
And I should be able to get their ids
Scenario: Delete categories
Given the following categories
|name |
|Food |
Then I should be able to list their names
And I should be able to get their ids
And I should be able to delete the above by name
Scenario: Child categories do not exist anymore Given the following categories |name | |Fast food | |Shawormas | |Healthy food| Then I should not be able to find them by name
Expose REST methods to manage the Expenses resource:
GET /api/expenses - to list current user's expenses GET /api/expenses/:id - to get the details for expense with :id of the current user POST /api/expenses - to create a new expense PUT /api/expenses/:id - to update the expense record with id :id DELETE /api/expenses/:id - to delete the expense record with id :id