FactoryBot.define do factory :task_template, class: Ecom::Core::TaskTemplate do sequence :code do |n| "TTCode#{n}" end name { FFaker::Name.name } description { FFaker::Name.name } association :task_template_type association :unit_of_measure has_takeoff_fields { false } takeoff_fields { [{ name: 'length', label: 'Length' }] } percentage_contribution { nil } task_sequence { 1 } has_inspection { false } discipline { false } task_completion_detail do [ { name: 'length', label: 'Length' }, { name: 'width', label: 'Width' } ] end end end