File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -34,16 +34,14 @@ func TestPostRepository(t *testing.T) {
34
34
35
35
postRepository .Create (postToCreate )
36
36
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 )
41
40
42
- gotPost := (* gotPosts )[0 ]
43
41
wantPost := postToCreate
44
42
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
47
45
48
- assert .Equal (t , * postToCreate , ( * gotPosts ) [0 ])
46
+ assert .Equal (t , * postToCreate , gotPosts [0 ])
49
47
}
You can’t perform that action at this time.
0 commit comments