Wednesday, December 3, 2008

custom assert_select_rjs matcher

Background:
I wanted to test rjs redirection:


Problem:
ActionController::Assertions::SelectorAssertions#assert_select_rjs don't know about :redirect_to

Solution:
I don't know if this is the right solution but I added this at the end of my test_helper.rb then I can assert by :redirect_to now


1 comment:

Uberllama said...

This was just the trick for a search I was writing today! FYI, I noticed a patch ticket for this in the rails lighthouse, so I expect it to be in an official release soon. Cheers.