// putUser403 validates that a user can't modify users unless they are an admin.
putUser403 validates that a user can't modify users unless they are an admin.
// putUser403 validates that a user can ' t modify users unless they are an admin .
func putUser403(t *testing.T, id string) {
	body := `{"name": "Anna Walker"}`
	r := httptest.NewRequest("PUT", "/v1/users/"+id, strings.NewReader(body))
	w := httptest.NewRecorder()
	r.Header.Set("Authorization", userAuthorization)
	a.ServeHTTP(w, r)
	t.Log("Given the need to update a user with the users endpoint.")
	{
		t.Log("\tTest 0:\tWhen a non-admin user makes a request")
		{
			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 putUser403 ( t * testing . T , id string ) { body := `{"name": "Anna Walker"}` r := httptest . NewRequest ( " " , " " + id , strings . NewReader ( 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 ) } } }
putUser403 validates that a user can't modify users unless they are an admin.
putUser403 validates that a user can ' t modify users unless they are an admin .