Skip to content

Commit

Permalink
Add an ingredient factory
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Jun 30, 2021
1 parent 57dc0fb commit 9234ecd
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/alchemy/test_support/factories/ingredient_factory.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

FactoryBot.define do
%w[
audio
boolean
datetime
file
headline
html
link
node
page
picture
richtext
select
text
].each do |ingredient|
factory :"alchemy_ingredient_#{ingredient}", class: "Alchemy::Ingredients::#{ingredient.classify}" do
role { ingredient }
type { "Alchemy::Ingredients::#{ingredient.classify}" }
association :element, name: "all_you_can_eat_ingredients", factory: :alchemy_element
end
end
end

0 comments on commit 9234ecd

Please sign in to comment.