如何将 :subscriber 工厂中的 'email' 属性值传递给它的关联 :authentication
例如:
factory :subscriber, :class => Subscriber do
sequence(:name) { |n| "test_user_#{n}" }
sequence(:email) { |n| "test_user_#{n}@example.com"}
association :authentication, factory: :authentication, email: email
end
factory :authentication do
sequence(:email) { |n| "test_user_#{n}@example.com"}
password 'pass'
end
给我错误
ArgumentError:
Trait not registered: email