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 has_takeoff_fields { false } fields { [{ name: 'length', label: 'Length' }] } task_steps do [{ "name": 'Cutting', "total_contribution_percentage_to_task": 100 }] end end end