Next, you must decorate the controllers in your area with the ActionLinkArea attribute from the Microsoft.Web.Mvc namespace of the MVC 3 Futures project (available via NuGet). This is used by the strongly-typed ActionLink HtmlHelpers and other strongly-typed helpers, and it’s also utilized by SpecsFor.Mvc, which is built on the same underlying conventions. You can check out the demo application in the SpecsFor solution for a working example. SpecsFor.Mvc will likely expose this convention so that it can be customized beginning with the 2.0 release.

Testing Static Apps

Not all apps are well-suited for SpecsFor.Mvc’s embedded IIS Express host. Maybe you have a Continuous Deployment environment that you want to point SpecsFor.Mvc at. You could do this in 1.0 by directly assigning the MvcWebApp.BaseUrl property, but SpecsFor.Mvc 1.1 introduces the new UseApplicationAtUrl method:

Do note that this method is not compatible with applying Web.config transforms.

FluentField Is Now Extension Method-Friendly

In version 1.0, FluentField maintained all of its state internally, meaning you did not have access to the underlying IWebElement, the form, or even the MvcWebApp instance the field was pulled from. I’ve changed that in 1.1 (thanks, @KillaVanKells for the suggestion), so you can now write your own extension methods of off FluentField. If there’s interest, I may stand up an official SpecsFor.Mvc.Contrib project for people to submit extension methods to.

About Matt Honeycutt...

Matt Honeycutt is a software architect specializing in ASP.NET web applications, particularly ASP.NET MVC. He has over a decade of experience in building (and testing!) web applications.
He’s an avid practitioner of Test-Driven Development, creating both the SpecsFor and SpecsFor.Mvc frameworks.

He's also an author for Pluralsight,
where he publishes courses on everything from web applications to testing!