Skip to content

Commit 1a4788b

Browse files
test: fix tests after merge
1 parent b751c59 commit 1a4788b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/integration/post_repository_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@ func TestPostRepository(t *testing.T) {
3434

3535
postRepository.Create(postToCreate)
3636

37-
gotPosts := new([]models.Post)
38-
postRepository.GetPosts(gotPosts)
39-
require.NotNil(t, gotPosts)
40-
require.Len(t, (*gotPosts), 1)
37+
gotPosts, err := postRepository.GetPosts()
38+
require.NoError(t, err)
39+
require.Len(t, gotPosts, 1)
4140

42-
gotPost := (*gotPosts)[0]
4341
wantPost := postToCreate
4442
wantPost.User = user
45-
wantPost.CreatedAt = gotPost.CreatedAt
46-
wantPost.UpdatedAt = gotPost.UpdatedAt
43+
wantPost.CreatedAt = gotPosts[0].CreatedAt
44+
wantPost.UpdatedAt = gotPosts[0].UpdatedAt
4745

48-
assert.Equal(t, *postToCreate, (*gotPosts)[0])
46+
assert.Equal(t, *postToCreate, gotPosts[0])
4947
}

0 commit comments

Comments
 (0)