Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
factory :search_results_resps, class: 'OpenStruct' do
variant_id { variant.id }
product_name { variant.product.name }
product_brand_name { variant.product.brand_name.to_s }
flavor { variant.flavor.to_s }
warehouse_category { variant.product.warehouse_category.to_s }
skip_container { variant.skip_container }
transient do
variant nil
end
end
# In test example
FactoryBot.attributes_for(:search_results_resps, variant: product.variants.first)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment