(Moving what used to be a page to a post)
Today was the test day. I was happily coding away tests until i ran into this issue. I had a form and i wanted to check for the form action. I did an assert_select on the form based on the action attribute and and i was using url_for for equality. In other code, i did something like:
assert_select “form[class=my_form_class_name][action=?]“, url_for(:controller => :my_form_controller, :action => :my_form_action)
And this was what was causing the problem. In my test scenario, url_for was generating absolute urls and in the development/production scenario, it was giving root relative urls. So, the assert_select was always failing and it took me a while to understand what was actually happening.