This commit is contained in:
Natalia Villegas 2018-12-06 15:37:56 -03:00
parent de0e1d54ca
commit 04e44e195c

View file

@ -126,4 +126,15 @@ public class PetControllerTests {
.andExpect(view().name("pets/createOrUpdatePetForm"));
}
@Test
public void testProcessUpdateFormHasErrorsLength() throws Exception {
mockMvc.perform(post("/owners/{ownerId}/pets/{petId}/edit", TEST_OWNER_ID, TEST_PET_ID)
.param("name", "")
)
.andExpect(model().attributeHasErrors("pet"))
.andExpect(status().isOk())
.andExpect(view().name("pets/createOrUpdatePetForm"));
}
}