Displaying 1 result from an estimated 1 matches for "sysadminrole".
Did you mean:
sysadmin_role
2010 Sep 25
3
Factory_girl association with specific values
Hope this should be simple: I have a User model and a Role model. Factories
for each.
When I create a User using FG, I want to assign a specific role. Cant seem
to figure out how to do this, getting errors like: uninitialized constant
SysadminRole for doing things this way:
Factory.define :user do |u|
u.practice_id { |a| a.association(:practice).id }
u.password ''password1''
u.password_confirmation ''password1''
u.role { |a| a.association(:sysadmin_role) }
end
Factory.define :sysadmin_role do |f|
f...