On Mon, Aug 01, 2011 at 08:40:59PM +1000, Simon Harris wrote:
On 01/08/2011, at 8:34 PM, Simon Harris wrote:
> From tracing it through, factory girl seems to execute the super type definition
BEFORE the sub type therefore before u.login 'admin' can be run, the user is
created with no login and thus the email is set to "(a)example.host". Note the
empty user name.
But even that seems odd as I would have expected
u.sequence(:login) { |n| "user#{n}" }
to have assigned a login :/
Perhaps not the most helpful response here, but I'm similarly stumped. I
traced it back to the same line (without realizing you had already done
so), but can't figure out why it's misbehaving after the upgrade.
I 'fixed' it with u.email { |e| "#{e.login ||
'user'}(a)example.host" },
though obviously this is a cheap hack. But it does confirm that the
problem is what you described -- the email has no user part.
Crazier still, I tried adding "u.login 'foo'" between the u.sequence
and
u.email lines, and got the error that login was already assigned. So it
looks like it's being assigned to nil/blank, as opposed to not being set
at all.
My day's starting to draw to a close, so I'm not sure I'm going to be
able to solve this problem tonight, if you're inclined to keep poking.
If not, I'll try to tackle this thing tomorrow, as it blocks a bunch of
other tests.
Tangentially, but while we're talking about tests, cucumber-rails 0.5
dropped support for webrat[1], so we're going to need to get everything
switched over to capybara. Seems like it might just be a handful of
scattered errors as opposed to requiring a complete rewrite of steps.
-- Matt
[1]
https://groups.google.com/group/cukes/browse_thread/thread/e0a6107f127c9d82