Fix tests, add trophies endpoint for account, edit trophies struct

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-06-27 23:15:27 -04:00
parent cad26daa3b
commit c8d7abf216
8 changed files with 114 additions and 73 deletions
+13 -5
View File
@@ -52,7 +52,7 @@ var expectedPost = Post{
Created: &Timestamp{time.Date(2020, 5, 3, 22, 46, 25, 0, time.UTC)},
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
Permalink: "/r/redditdev/comments/gczwql/get_userusernamegilded_does_it_return_other_users/",
Permalink: "https://www.reddit.com/r/redditdev/comments/gczwql/get_userusernamegilded_does_it_return_other_users/",
URL: "https://www.reddit.com/r/redditdev/comments/gczwql/get_userusernamegilded_does_it_return_other_users/",
Title: "GET /user/{username}/gilded: does it return other user's things you've gilded, or your things that have been gilded? Does it return both comments and posts?",
@@ -81,7 +81,7 @@ var expectedComment = Comment{
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
ParentID: "t3_d7ejpn",
Permalink: "/r/apple/comments/d7ejpn/im_giving_away_an_iphone_11_pro_to_a_commenter_at/f0zsa37/",
Permalink: "https://www.reddit.com/r/apple/comments/d7ejpn/im_giving_away_an_iphone_11_pro_to_a_commenter_at/f0zsa37/",
Body: "Thank you!",
Author: "v_95",
@@ -116,9 +116,17 @@ var expectedBlocked = &Blocked{
Created: &Timestamp{time.Date(2020, 6, 16, 16, 49, 50, 0, time.UTC)},
}
var expectedTrophies = Trophies{
{Name: "Three-Year Club"},
{Name: "Verified Email"},
var expectedTrophies = []Trophy{
{
ID: "",
Name: "Three-Year Club",
Description: "",
},
{
ID: "1q1tez",
Name: "Verified Email",
Description: "",
},
}
func TestUserService_Get(t *testing.T) {