Testing MonoRail Filters

I was trying to test an Authentication Filter today that needed to redirect the user to a login page.

The problem was that it used context.Controller.Url, context was a MockRailsEngineContext and the Url property throws a NotImplementedException. Ayende quickly jumped on the ball and resolved the problem! Dang that was fast.

If you need to do the same just grab the trunk and it now that property will return a value rather than an exception.

 Thanks Ayende!

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Sean Chambers

I am a Senior software developer from Palm Coast, Florida. An advocate of Domain Driven Design, Behavior Driven Development, creator of FluentMigrator and community activist. I am married to my beautiful wife Erin and am the proud father of two wonderful children. I currently reside at ACI, a local insurance industry/mortgage software company that excels in creating solutions using Agile methodologies.
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://www.lostechies.com/blogs/joe_ocampo/ Joe Ocampo

    I sill believe that Oren(Ayende) is an alien who doesn’t sleep. :-)

  • http://www.lostechies.com/blogs/sean_chambers Sean Chambers

    I’m starting to believe it as well Joe. I’ve never seen anyone churn out more code than that guy. Amazing…