Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)copy! share!
posted at 24. Aug '21

Howto Use FactoryBot Factories In Development Rails Console

Sometimes you just want to copy setup code from tests which don’t use FactoryBot.create, but just create.

include FactoryBot::Syntax::Methods
include ActionDispatch::TestProcess

The second one is not really needed for modern codebase which uses Rack::UploadedFile to upload images or attachments instead of fixture_upload.

Add Comment