FactoryBot.define do factory :task, class: Ecom::Core::Task do sequence :code do |n| "TCode#{n}" end name { FFaker::Name.name } description { FFaker::Name.name } start_date { Date.yesterday } end_date { Date.today } status { :new } percent_completed { 0 } remark { FFaker::Name.name } inspection_submission_date { Date.today } inspection_status { Ecom::Core::Task::NOT_INSPECTED } change_order { false } change_order_for { nil } percentage_contribution { nil } association :performer, factory: :user association :client_consultant, factory: :user association :foreman, factory: :user association :inspector, factory: :user association :task_template association :work_product association :work_package end end