diff options
author | Corey Hulen <corey@hulen.com> | 2015-06-19 10:41:56 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-06-19 10:41:56 -0800 |
commit | 8291cb772c1f2b410c08c5fb71c07ef9ca07b0ce (patch) | |
tree | 80e91b8343f567f301d247392d09ba620909076d /api/user_test.go | |
parent | 98d9050d07657c696a9c7ba8a1262d3fe8708623 (diff) | |
parent | a76ee16480aea34d13331490a661e8622f6eb508 (diff) | |
download | chat-8291cb772c1f2b410c08c5fb71c07ef9ca07b0ce.tar.gz chat-8291cb772c1f2b410c08c5fb71c07ef9ca07b0ce.tar.bz2 chat-8291cb772c1f2b410c08c5fb71c07ef9ca07b0ce.zip |
Merge pull request #40 from mattermost/image-fix
HELIUM profile image now generates on each call if S3 is not configured
Diffstat (limited to 'api/user_test.go')
-rw-r--r-- | api/user_test.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/api/user_test.go b/api/user_test.go index 4d5d2b3f0..92ab216aa 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -10,6 +10,7 @@ import ( "github.com/goamz/goamz/s3" "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" + "image" "image/color" "io" "mime/multipart" @@ -324,14 +325,20 @@ func TestGetAudits(t *testing.T) { func TestUserCreateImage(t *testing.T) { Setup() - i := createProfileImage("Corey Hulen", "eo1zkdr96pdj98pjmq8zy35wba") - if i == nil { - t.Fatal("Failed to gen image") + b, err := createProfileImage("Corey Hulen", "eo1zkdr96pdj98pjmq8zy35wba") + if err != nil { + t.Fatal(err) + } + + rdr := bytes.NewReader(b) + img, _, err2 := image.Decode(rdr) + if err2 != nil { + t.Fatal(err) } colorful := color.RGBA{116, 49, 196, 255} - if i.RGBAAt(1, 1) != colorful { + if img.At(1, 1) != colorful { t.Fatal("Failed to create correct color") } |