私はこの工場を持っています:
FactoryGirl.define do
factory :asset_size do
sequence(:name) { |n| "AssetSize#{n}" }
after_create do |as|
FactoryGirl.create(:midpoint, :asset_size => as)
FactoryGirl.create(:midpoint, :asset_size => as, :grade => 18, :yearly_wage => 25000.00)
end
end
end
しかし、このエラーが発生し続けます:
AssetSize(#70166742384960) expected, got #<Class:0x007fa1eddef738>(#70166728637340) (ActiveRecord::AssociationTypeMismatch) ./spec/factories/asset_size_factory.rb:7:in `block (3 levels) in './features/step_definitions/role_authorization_steps.rb:2:in `/^a basic balanced results employee$/'./features/role_authorization.feature:4:in `Given a basic balanced results employee'
after_create do |as|
FactoryGirl.create(:midpoint, :asset_size => as)
FactoryGirl.create(:midpoint, :asset_size => as, :grade => 18, :yearly_wage => 25000.00)
エラーは理解できますが、構文がどのようにずれているのかわかりません。