~samwhited/avatar

ref: f2411809f12c87169db2d03dc1f23d9570e44045 avatar/avatars_test.go -rw-r--r-- 419 bytes
f2411809Sam Whited Initial public release 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package avatar_test

import (
	"net/http/httptest"
	"testing"

	"code.soquee.net/avatar"
)

func TestAvatarContentType(t *testing.T) {
	h := avatar.Handler()

	req := httptest.NewRequest("GET", "/avatars", nil)
	w := httptest.NewRecorder()
	h.ServeHTTP(w, req)

	const expect = "image/png"
	ct := w.Header().Get("Content-Type")
	if ct != expect {
		t.Errorf("Unexpected Content-Type: want=%q, got=%q", expect, ct)
	}
}