Skip to content

Commit

Permalink
Merge pull request #23 from djengua/task/handlers
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
djengua committed Dec 28, 2023
2 parents 3b5531d + 925be0a commit 442ea9a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions handlers/translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ func TestTranslateAPI(t *testing.T) {
ExpectedLanguage: "german",
ExpectedTranslation: "bar",
},
{
Endpoint: "/translate/baz",
StatusCode: http.StatusNotFound,
ExpectedLanguage: "",
ExpectedTranslation: "",
},
}
h := handlers.NewTranslateHandler(&stubbedService{})
handler := http.HandlerFunc(h.TranslateHandler)
Expand All @@ -72,11 +66,11 @@ func TestTranslateAPI(t *testing.T) {
_ = json.Unmarshal(rr.Body.Bytes(), &resp)

if resp.Language != test.ExpectedLanguage {
t.Errorf(`expected language "%s" but received %s`, test.ExpectedLanguage, resp.Language)
t.Errorf(`expected language "%s" but received "%s"`, test.ExpectedLanguage, resp.Language)
}

if resp.Translation != test.ExpectedTranslation {
t.Errorf(`expected language "%s" but received %s`, test.ExpectedTranslation, resp.Translation)
t.Errorf(`expected language "%s" but received "%s"`, test.ExpectedTranslation, resp.Translation)
}

}
Expand Down

0 comments on commit 442ea9a

Please sign in to comment.