// postUser401 validates a user can't be created unless the calling user is
// authenticated.
postUser401 validates a user can't be created unless the calling user is
authenticated.
// postUser401 validates a user can ' t be created unless the calling user is // authenticated .
func postUser401(t *testing.T) {
	body, err := json.Marshal(&user.User{})
	if err != nil {
		t.Fatal(err)
	}
	r := httptest.NewRequest("POST", "/v1/users", bytes.NewBuffer(body))
	w := httptest.NewRecorder()
	r.Header.Set("Authorization", userAuthorization)
	a.ServeHTTP(w, r)
	t.Log("Given the need to validate a new user can't be created with an invalid document.")
	{
		t.Log("\tTest 0:\tWhen using an incomplete user value.")
		{
			if w.Code != http.StatusForbidden {
				t.Fatalf("\t%s\tShould receive a status code of 403 for the response : %v", tests.Failed, w.Code)
			}
			t.Logf("\t%s\tShould receive a status code of 403 for the response.", tests.Success)
		}
	}
}
func postUser401 ( t * testing . T ) { body , err := json . Marshal ( & user . User { } ) if err != nil { t . Fatal ( err ) } r := httptest . NewRequest ( " " , " " , bytes . NewBuffer ( body ) ) w := httptest . NewRecorder ( ) r . Header . Set ( " " , userAuthorization ) a . ServeHTTP ( w , r ) t . Log ( " " ) { t . Log ( " \t \t " ) { if w . Code != http . StatusForbidden { t . Fatalf ( " \t \t " , tests . Failed , w . Code ) } t . Logf ( " \t \t " , tests . Success ) } } }
postUser401 validates a user can't be created unless the calling user is
authenticated.
postUser401 validates a user can ' t be created unless the calling user is authenticated .