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

플러그인에서도 커스텀 fabricator를 정의할 필요가 있었는데, 이미 적절한 지원이 없다는 점이 놀라웠습니다.

위 PR이 병합되면, 플러그인의 spec/fabricators 폴더에 존재하는 fabricator는 자동으로 require됩니다.