aboutsummaryrefslogtreecommitdiffstats
path: root/integrations
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2019-12-18 14:07:36 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2019-12-18 21:07:36 +0800
commit6d811bcb14eb7199452d2673a6c30412989f7498 (patch)
treeaa5b16dc73b0cf7d4fa53b770a1fbb5f85d5daee /integrations
parent3b4682e1722441a2c64f0bacd05aa795f8fb27da (diff)
downloadgitea-6d811bcb14eb7199452d2673a6c30412989f7498.tar.gz
gitea-6d811bcb14eb7199452d2673a6c30412989f7498.zip
Hide not allowed Reactions (#9387)
* Hide not allowed Reactions * filter in query :D * use ` Co-Authored-By: Alexey 〒erentyev <axifnx@gmail.com> * update xorm v0.8.0 -> v0.8.1
Diffstat (limited to 'integrations')
-rw-r--r--integrations/api_issue_reaction_test.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/integrations/api_issue_reaction_test.go b/integrations/api_issue_reaction_test.go
index f3fcf3946f..c474f7bad2 100644
--- a/integrations/api_issue_reaction_test.go
+++ b/integrations/api_issue_reaction_test.go
@@ -26,7 +26,6 @@ func TestAPIIssuesReactions(t *testing.T) {
session := loginUser(t, owner.Name)
token := getTokenForLoggedInUser(t, session)
- user1 := models.AssertExistsAndLoadBean(t, &models.User{ID: 1}).(*models.User)
user2 := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/reactions?token=%s",
owner.Name, issue.Repo.Name, issue.Index, token)
@@ -61,17 +60,12 @@ func TestAPIIssuesReactions(t *testing.T) {
DecodeJSON(t, resp, &apiReactions)
expectResponse := make(map[int]api.ReactionResponse)
expectResponse[0] = api.ReactionResponse{
- User: user1.APIFormat(),
- Reaction: "zzz",
- Created: time.Unix(1573248002, 0),
- }
- expectResponse[1] = api.ReactionResponse{
User: user2.APIFormat(),
Reaction: "eyes",
Created: time.Unix(1573248003, 0),
}
- expectResponse[2] = apiNewReaction
- assert.Len(t, apiReactions, 3)
+ expectResponse[1] = apiNewReaction
+ assert.Len(t, apiReactions, 2)
for i, r := range apiReactions {
assert.Equal(t, expectResponse[i].Reaction, r.Reaction)
assert.Equal(t, expectResponse[i].Created.Unix(), r.Created.Unix())