Another Quick Tip: Asserting view renders in a MonoRail controller test
This is another one of those “blog it so I can remember it” posts.
My last post about a similar tip was relating to asserting redirects in a MonoRail controller. This one deals with asserting which view is being rendered in your controller when only RenderView is called.
1: public class CheckoutController : BaseController
3: public void ValidateOrder(CheckoutOrderDTO orderToValidate)
5: // code to validate order
Controller Test Code
1: Assert.AreEqual(@"checkoutreview", controller.SelectedViewName);
It’s a subtle difference from asserting redirects, because it doesn’t require the leading ”/” or the “.rails” extension to be included.
This entry was posted in castle
. Bookmark the permalink
. Follow any comments here with the RSS feed for this post