From 274675d02a5a2f830880a45c6a0cd07d2c2fb7e6 Mon Sep 17 00:00:00 2001
From: Sebastiaan de Schaetzen <sebastiaan.de.schaetzen@gmail.com>
Date: Wed, 14 May 2025 15:32:26 +0200
Subject: [PATCH] Rename allowance to history

---
 backend/api_test.go | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/backend/api_test.go b/backend/api_test.go
index 75a7d54..39e71d2 100644
--- a/backend/api_test.go
+++ b/backend/api_test.go
@@ -323,7 +323,7 @@ func createTestTask(e *httpexpect.Expect) {
 	e.POST("/tasks").WithJSON(requestBody).Expect().Status(201)
 }
 
-func TestGetTaskSWhenTasks(t *testing.T) {
+func TestGetTasksWhenTasks(t *testing.T) {
 	e := startServer(t)
 	createTestTask(e)
 
@@ -391,9 +391,9 @@ func TestPutTaskInvalidTaskId(t *testing.T) {
 func TestPostAllowance(t *testing.T) {
 	e := startServer(t)
 
-	e.POST("/user/1/allowance").WithJSON(PostAllowance{Allowance: 100}).Expect().Status(200)
-	e.POST("/user/1/allowance").WithJSON(PostAllowance{Allowance: 20}).Expect().Status(200)
-	e.POST("/user/1/allowance").WithJSON(PostAllowance{Allowance: -10}).Expect().Status(200)
+	e.POST("/user/1/history").WithJSON(PostAllowance{Allowance: 100}).Expect().Status(200)
+	e.POST("/user/1/history").WithJSON(PostAllowance{Allowance: 20}).Expect().Status(200)
+	e.POST("/user/1/history").WithJSON(PostAllowance{Allowance: -10}).Expect().Status(200)
 
 	response := e.GET("/user/1").Expect().Status(200).JSON().Object()
 	response.Value("allowance").Number().IsEqual(100 + 20 - 10)
@@ -402,16 +402,16 @@ func TestPostAllowance(t *testing.T) {
 func TestPostAllowanceInvalidUserId(t *testing.T) {
 	e := startServer(t)
 
-	e.POST("/user/999/allowance").WithJSON(PostAllowance{Allowance: 100}).Expect().
+	e.POST("/user/999/history").WithJSON(PostAllowance{Allowance: 100}).Expect().
 		Status(404)
 }
 
 func TestGetHistory(t *testing.T) {
 	e := startServer(t)
 
-	e.POST("/user/1/allowance").WithJSON(PostAllowance{Allowance: 100}).Expect().Status(200)
-	e.POST("/user/1/allowance").WithJSON(PostAllowance{Allowance: 20}).Expect().Status(200)
-	e.POST("/user/1/allowance").WithJSON(PostAllowance{Allowance: -10}).Expect().Status(200)
+	e.POST("/user/1/history").WithJSON(PostAllowance{Allowance: 100}).Expect().Status(200)
+	e.POST("/user/1/history").WithJSON(PostAllowance{Allowance: 20}).Expect().Status(200)
+	e.POST("/user/1/history").WithJSON(PostAllowance{Allowance: -10}).Expect().Status(200)
 
 	response := e.GET("/user/1/history").Expect().Status(200).JSON().Array()
 	response.Length().IsEqual(3)