diff --git a/api/v2/routes_swarm_test.go b/api/v2/routes_swarm_test.go index fcb7d60a9..5430e6f4c 100644 --- a/api/v2/routes_swarm_test.go +++ b/api/v2/routes_swarm_test.go @@ -63,7 +63,7 @@ func Test_Routes_Swarm(t *testing.T) { if testRecorder.Code != 200 { t.Fatal("bad http status code recovered from /v2/swarm/upload") } - var apiResp apiResponse + var apiResp mapAPIResponse bodyBytes, err := ioutil.ReadAll(testRecorder.Result().Body) if err != nil { t.Fatal(err) @@ -74,4 +74,10 @@ func Test_Routes_Swarm(t *testing.T) { if apiResp.Code != 200 { t.Fatal("bad api response status code from /v2/swarm/upload") } + if apiResp.Response["swarm_hash"].(string) == "" { + t.Fatal("invalid swarm hash returned") + } + if apiResp.Response["ipfs_hash"].(string) == "" { + t.Fatal("invalid ipfs hash returned") + } }