public void ShouldRedirectToAcceptedViewOnSuccessfulApplication() { var sut = new HomeController(); var application = new Application { IsAccepted = true }; sut.WithCallTo(x => x.Index(application)).ShouldRedirectTo(x => x.Accepted); }
public ActionResult Index(Application application) { if (!ModelState.IsValid) { return View(application); } if (application.IsAccepted) { return RedirectToAction("Accepted"); } else { return RedirectToAction("Rejected"); } }