mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
Added ItemControllerTestr
This commit is contained in:
parent
bee2dc3de2
commit
4ce18938a5
@ -46,3 +46,17 @@ func TestInvalidItem(t *testing.T) {
|
||||
assert.Equal(t, 400, w.Code)
|
||||
})
|
||||
}
|
||||
|
||||
func TestValidItem(t *testing.T) {
|
||||
runTestCase(t, func(
|
||||
handler lib.RequestHandler,
|
||||
) {
|
||||
req, _ := http.NewRequest("POST", "/update_quality", strings.NewReader(`
|
||||
{ "days": 1, "items": [{ "name": "Random normal item", "quality": 5, "sellIn": 5}]}
|
||||
`))
|
||||
req.Header = map[string][]string{"Content-Type": {"application/json"}}
|
||||
|
||||
w := executeRequest(handler, req)
|
||||
assert.Equal(t, 200, w.Code)
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user