Are there any examples of plugins defining Fabricators?
I found something here that may be relevant: https://github.com/paulelliott/fabrication/issues/167
It says that it clears existing fabricators…
Are there any examples of plugins defining Fabricators?
I found something here that may be relevant: https://github.com/paulelliott/fabrication/issues/167
It says that it clears existing fabricators…
It’s actually quite simple.
spec/plugin_helper.rb
to your plugin if you haven’t got that already.spec/fabricators
and add your factories in there*rb
files in plugin_helper.rb
I had a need to define custom fabricators in my plugin as well and was surprised that we don’t already have proper support for it.
https://github.com/discourse/discourse/pull/15106
Once the above PR has been merged, your fabricators will automatically be required as long as they exists in the plugin’s spec/fabricators
folder.