Fix TestNewImageAttachment tests

This commit is contained in:
Matt Baer
2021-09-13 15:32:27 -04:00
parent 8b45bd4fcc
commit 76e2651b5c
+4 -4
View File
@@ -12,19 +12,19 @@ func TestNewImageAttachment(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
args args args args
want *Attachment want Attachment
}{ }{
{name: "good svg", args: args{"https://writefreely.org/img/writefreely.svg"}, want: &Attachment{ {name: "good svg", args: args{"https://writefreely.org/img/writefreely.svg"}, want: Attachment{
Type: "Image", Type: "Image",
URL: "https://writefreely.org/img/writefreely.svg", URL: "https://writefreely.org/img/writefreely.svg",
MediaType: "image/svg+xml", MediaType: "image/svg+xml",
}}, }},
{name: "good png", args: args{"https://i.snap.as/12345678.png"}, want: &Attachment{ {name: "good png", args: args{"https://i.snap.as/12345678.png"}, want: Attachment{
Type: "Image", Type: "Image",
URL: "https://i.snap.as/12345678.png", URL: "https://i.snap.as/12345678.png",
MediaType: "image/png", MediaType: "image/png",
}}, }},
{name: "no extension", args: args{"https://i.snap.as/12345678"}, want: &Attachment{ {name: "no extension", args: args{"https://i.snap.as/12345678"}, want: Attachment{
Type: "Image", Type: "Image",
URL: "https://i.snap.as/12345678", URL: "https://i.snap.as/12345678",
MediaType: "", MediaType: "",