From ecb10ed62fdff179e34f82b0ff2569da8390f4ad Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Sat, 22 Apr 2017 21:52:03 +0900 Subject: APIv4 DELETE /users/{user_id}/posts/{post_id}/reactions/name (#6117) * APIv4 DELETE /users/{user_id}/posts/{post_id}/reactions/name * updated v3 deleteReaction endpoint * update parameter of app.DeleteReactionForPost() * update utils.IsValidAlphaNum, add utils.IsValidAlphaNumHyphenUnderscore, and add related tests --- model/reaction_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'model/reaction_test.go') diff --git a/model/reaction_test.go b/model/reaction_test.go index e980b106d..e447e4329 100644 --- a/model/reaction_test.go +++ b/model/reaction_test.go @@ -57,6 +57,21 @@ func TestReactionIsValid(t *testing.T) { t.Fatal(err) } + reaction.EmojiName = "emoji-" + if err := reaction.IsValid(); err != nil { + t.Fatal(err) + } + + reaction.EmojiName = "emoji_" + if err := reaction.IsValid(); err != nil { + t.Fatal(err) + } + + reaction.EmojiName = "emoji:" + if err := reaction.IsValid(); err == nil { + t.Fatal(err) + } + reaction.CreateAt = 0 if err := reaction.IsValid(); err == nil { t.Fatal("create at should be invalid") -- cgit v1.2.3-1-g7c22