From 0afb796085d47c7cc09a2f69920dbcc1c7f28c81 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 2 Dec 2017 17:30:28 +0800 Subject: [PATCH] add HTML Entities testing. #50 Signed-off-by: Bo-Yi Wu --- plugin_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/plugin_test.go b/plugin_test.go index 5e6f4a3..8b0d667 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -272,3 +272,31 @@ func TestConvertLocation(t *testing.T) { Longitude: float64(139.704051), }, result) } + +func TestHTMLMessage(t *testing.T) { + plugin := Plugin{ + Repo: Repo{ + Name: "go-hello", + Owner: "appleboy", + }, + Commit: Commit{ + Sha: "e7c4f0a63ceeb42a39ac7806f7b51f3f0d204fd2", + Author: "Bo-Yi Wu", + Branch: "master", + Message: "Freakin' macOS isn't fully case-sensitive..", + }, + Build: Build{ + Number: 101, + Status: "success", + Link: "https://github.com/appleboy/go-hello", + }, + + Config: Config{ + Token: os.Getenv("TELEGRAM_TOKEN"), + To: []string{os.Getenv("TELEGRAM_TO")}, + }, + } + + err := plugin.Exec() + assert.Nil(t, err) +}