FactoryBot.define do factory :work_component, class: 'Ecom::Core::WorkComponent' do name { FFaker::Name.name } dimension { [{ label: 'Length', name: 'length', value: 10 }] } assignment_status { :unassigned } task_status { :new } percent_completed { FFaker::Random.rand(1..100) } remark { FFaker::Name.name } association :performer, factory: :user association :approver, factory: :user association :supervisor, factory: :user association :quality_controller, factory: :user start_date { 1.day.ago } completion_date { Time.now.next_week } association :work_component_template association :work_product end end