FactoryBot.define do factory :promotion_attribute do name "Attribute Name" # Data Type could be text, integer, date, list_drop_down (Select from a List), list_radio_button (Choose one) & boolean (Checkbox) data_type "text" mandatory false promotion end factory :text_promotion_attribute, parent: :promotion_attribute do data_type "text" end factory :integer_promotion_attribute, parent: :promotion_attribute do data_type "integer" end factory :date_promotion_attribute, parent: :promotion_attribute do data_type "date" end factory :list_drop_down_promotion_attribute, parent: :promotion_attribute do data_type "list_drop_down" values ["Value 1", "Value 2", "Value 3"] end factory :list_radio_button_promotion_attribute, parent: :promotion_attribute do data_type "list_radio_button" values ["Radio 1", "Radio 2", "Radio 3"] end factory :boolean_promotion_attribute, parent: :promotion_attribute do data_type "boolean" end end