added doormen ownership

This commit is contained in:
didier amyot committed 2015-06-14 23:21:42 -04:00
1 parent f0628e4682
commit f7a8d416c1
27 files changed
+489 -126

No files matched your search

+6 -1
View File
@@ -16,7 +16,11 @@ func GetIdFromLocation(p string) bson.ObjectId {
func TestCreateDoorman(t *testing.T) {
conn = inmemoryconnector.NewInMemoryDBConnector()
payload := `{"name":"name","values":[{"name":"red","probability":0.2},{"name":"blue","probability":0.8}]}`
payload := `
{"name":"name",
"values":[{"name":"red","probability":0.2},{"name":"blue","probability":0.8}],
"emails": ["alice"]
}`
req, err := http.NewRequest(
"POST",
"http://bigtits.com/api/doormen",
@@ -26,6 +30,7 @@ func TestCreateDoorman(t *testing.T) {
t.Error(err)
return
}
SetUser(req, "alice")
w := httptest.NewRecorder()
CreateDoorman(w, req)
if w.Code != 201 {