Created
April 26, 2018 12:30
-
-
Save andriy-baran/c0dcb8dba5173879dd6402ac0f6788e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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