Skip to content

Commit

Permalink
test: fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandrkhmil committed Jan 17, 2025
1 parent bb52fc0 commit 9ae96eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/handler/post_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ func TestPostHandler_UpdatePost(t *testing.T) {
Content: "New Content",
}

createPostRequest := request.CreatePostRequest{
updatePostRequest := request.UpdatePostRequest{
BasicPost: &request.BasicPost{
Title: "New Title",
Content: "New Content",
},
}

rawCreatePostRequest, err := json.Marshal(createPostRequest)
rawUpdatePostRequest, err := json.Marshal(updatePostRequest)
require.NoError(t, err)

postService.
Expand All @@ -175,7 +175,7 @@ func TestPostHandler_UpdatePost(t *testing.T) {
Save(&newPost).
Return(nil)

httpRequest := httptest.NewRequest(http.MethodPut, "/post/100", bytes.NewReader(rawCreatePostRequest))
httpRequest := httptest.NewRequest(http.MethodPut, "/post/100", bytes.NewReader(rawUpdatePostRequest))

recorder := httptest.NewRecorder()
engine.ServeHTTP(recorder, httpRequest)
Expand Down

0 comments on commit 9ae96eb

Please sign in to comment.