Add message to deleted response

This commit is contained in:
Lena Fuhrimann 2017-04-09 22:44:06 +02:00
parent a40479a25f
commit 84072b3be3
4 changed files with 10 additions and 4 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
@ -17,6 +18,8 @@ func DeleteBucketHandler(s3 S3Client) http.Handler {
return
}
w.WriteHeader(http.StatusNoContent)
code := http.StatusNoContent
w.WriteHeader(code)
fmt.Fprint(w, http.StatusText(code))
})
}

View file

@ -20,7 +20,7 @@ func TestDeleteBucketHandler(t *testing.T) {
"success": {
s3: &S3ClientMock{},
expectedStatusCode: http.StatusNoContent,
expectedBodyContains: "",
expectedBodyContains: http.StatusText(http.StatusNoContent),
},
"s3 error": {
s3: &S3ClientMock{

View file

@ -1,6 +1,7 @@
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
@ -17,6 +18,8 @@ func DeleteObjectHandler(s3 S3Client) http.Handler {
return
}
w.WriteHeader(http.StatusNoContent)
code := http.StatusNoContent
w.WriteHeader(code)
fmt.Fprint(w, http.StatusText(code))
})
}

View file

@ -20,7 +20,7 @@ func TestDeleteObjectHandler(t *testing.T) {
"success": {
s3: &S3ClientMock{},
expectedStatusCode: http.StatusNoContent,
expectedBodyContains: "",
expectedBodyContains: http.StatusText(http.StatusNoContent),
},
"s3 error": {
s3: &S3ClientMock{