fix: all remaining "article" replaced by "post"

All instances of the term "article" were replaced with "post" in variable names, type names, function names, etc. This was primarily to ensure consistent naming and reduce confusion going forward. The term "post" was chosen as it's a more commonly used term for the involved operations in the context of content management and blogging platforms. All tests were also updated to reflect these changes.
This commit is contained in:
Florian Sylvain
2023-09-06 03:38:52 +02:00
parent 509329951f
commit e113c79a6d
8 changed files with 62 additions and 62 deletions
+5 -5
View File
@@ -67,12 +67,12 @@ var TestCreatePostTitleTooShort = func(t *testing.T) {
var TestGetPostSuccess = func(t *testing.T) {
var createdPost post.Post
var articleToCreate = post.Post{
var postToCreate = post.Post{
Title: "Test Title",
Body: "Test Body",
}
db := GetDb()
db.Create(&articleToCreate).Scan(&createdPost)
db.Create(&postToCreate).Scan(&createdPost)
r, _ := ApiRequest("GET", "/post/"+strconv.Itoa(int(createdPost.ID)), nil)
@@ -95,12 +95,12 @@ var TestGetPostSuccess = func(t *testing.T) {
var TestGetAllPostsSuccess = func(t *testing.T) {
var createdPost post.Post
var articleToCreate = post.Post{
var postToCreate = post.Post{
Title: "Test Title",
Body: "Test Body",
}
db := GetDb()
db.Create(&articleToCreate).Scan(&createdPost)
db.Create(&postToCreate).Scan(&createdPost)
r, _ := ApiRequest("GET", "/post", nil)
@@ -131,7 +131,7 @@ var TestPostGet = func(t *testing.T) {
}
var TestPostGetAll = func(t *testing.T) {
t.Run("Should return all articles", TestGetAllPostsSuccess)
t.Run("Should return all posts", TestGetAllPostsSuccess)
}
func TestPost(t *testing.T) {