It’s been a quiet few weeks for me after CodeStock, but I’m (finally) wrapping up some neglected tasks. 

[more]

Tonight I’ve published new versions of SpecsFor.Mvc and MvcDisplayTemplates to NuGet (code is on Github as always).  The new additions in SpecsFor.Mvc include the new FindLinkTo method and the ClickButton extension for IWebElement that works around some of the Selenium oddness when dealing with jQuery UI buttons.  You can see both of these in action in the newly-updated Fail Tracker code, which now illustrates using SpecFor.Mvc in a more real-world example:

public class when_adding_a_new_project : SpecsFor<MvcWebApp>
{
    protected override void When()
    {
        SUT.NavigateTo<ProjectAdministrationController>(c => c.Index());
        SUT.FindLinkTo<ProjectAdministrationController>(c => c.AddProject()).ClickButton();

        SUT.FindFormFor<AddProjectForm>()
            .Field(f => f.Name).SetValueTo("My Test Project")
            .Submit();
    }

    [Test]
    public void then_it_returns_to_the_project_administration_page()
    {
        SUT.Route.ShouldMapTo<ProjectAdministrationController>(c => c.Index());
    }

    [Test]
    public void then_it_should_have_the_new_project_listed()
    {
        SUT.FindDisplayFor<ProjectListViewModel>()
            .DisplayFor(m => m.Summaries[0].Name).Text.ShouldEqual("My Test Project");
    }

    [Test]
    public void then_the_new_project_has_one_member()
    {
        SUT.FindDisplayFor<ProjectListViewModel>()
            .DisplayFor(m => m.Summaries[0].Members).Text.ShouldEqual("1");
    }

    [Test]
    public void then_the_new_project_has_no_issues()
    {
        SUT.FindDisplayFor<ProjectListViewModel>()
            .DisplayFor(m => m.Summaries[0].ActiveStories).Text.ShouldEqual("0");
    }
}

I still have a lot of code to publish from my StructureMap session, but I hope to get that stuff online within the week. 

Oh, and I’m also speaking at aspConf next week!  If you want to hear more about SpecsFor.Mvc, be sure to check me out there!