Loading/defining fabricators in plugins

Are there any examples of plugins defining Fabricators?

I found something here that may be relevant: How to lazy load fabricators · Issue #167 · paulelliott/fabrication · GitHub

It says that it clears existing fabricators…

It’s actually quite simple. :slight_smile:

  • add spec/plugin_helper.rb to your plugin if you haven’t got that already.
  • create a folder spec/fabricators and add your factories in there
  • require the *rb files in plugin_helper.rb
إعجابَين (2)

كان لدي حاجة لتعريف مُصنِّعين مخصصين في المكون الإضافي الخاص بي أيضًا وفوجئت بأننا لا نملك دعمًا مناسبًا له بالفعل.

بمجرد دمج طلب السحب أعلاه، سيتم تلقائيًا طلب المُصنِّعين الخاصين بك طالما أنها موجودة في مجلد spec/fabricators الخاص بالمكون الإضافي.

إعجابَين (2)