I’m having a super strange functional testing issue, and was hoping
someone could provide some insight.
In my controller I have this in the index action:
@things = Thing.find(:all)
My index test looks like this:
assert_equal 1, assigns[:things].size
But the second assert causes an error. assigns[:things] is always nil
even though @things is getting assigned in the controller. If I do this
in the same test:
assert_equal 1, Thing.find(:all).size
It works. I have a reference to the things fixture in the test, so the
one record should be in the test db, and the manual find proves that.
I’m not sure why my instance var is always nil though