Ahh. I didn't realize the variable in the block stood for the object
being instantiated in the factory. That makes some sense, but with
that in place, when the user instance it creates does this:
_groups = self.groups
_default_group = _groups.select{|g| g == self.default_group}.first
...the _default_group var remains nil, which has been my problem all
along. Although outside of testing this code works fine.
--
Bill Kocik
Except for the part before the or, which is "if the
+comparison_object+ is the same object". In my case they are the same
object (or, at least, that's what I'm trying to achieve).
> So in your case, select{|g| g == self.default_group} is always
> returning an empty array. Your options are to change your default strategy
> to create (in which case the ids will match)
I changed it to create for both the user and group factories, and I'm
still getting the same result.
This is why I'm so stumped. It seems like this should be working, and
the live code works fine, but I can't get the test to work to save my
life.
Thanks for the help...