home.social

#factorybot — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #factorybot, aggregated by home.social.

fetched live
  1. The more I use #FactoryBot the more I dislike it. Its fine for the 'happy path' of an ActiveRecord, but when using it for mocking structured responses from APIs plain #Ruby objects with `def self.from(...)` constructors to pass in other domain objects would be less painful.

  2. In a way, I'm glad I let my #RSpec book grow stale for as long as I did. It’s enlightening to reflect on coding/testing habits I had 5+ years ago vs. now.

    I'm making updates accordingly—breaking up larger chapters/concepts into shorter, simpler takes. Reordering content so readers can be productive in their own codebases sooner.

    Anyway, next batch of updates coming this week, I hope, with some streamlined advice on getting started with #FactoryBot. Stay tuned, friends! leanpub.com/everydayrailsrspec

  3. I was surprised to find our FactoryBot factory files being loaded in development environment. Turns out to be because we include the factory_bot_rails gem in the development group, so we can use the rails generators it provides.

    The factory_bot_rails Readme mentions how to stop factories being autoloaded in development environment: github.com/thoughtbot/factory_ #rails #factorybot

  4. @searls has a free-as-in-puppy open source opportunity for the person who can give it a good home. We Rate Dogs would give test_data an 11/10: unique personality, super fast, and this Ruby gem gets along well with everyone.

    Consider it a reference implementation for a pattern that every web application framework should consider adopting. If that sounds intriguing maybe you're the one who should adopt test_data 🐶
    link.testdouble.com/new-ruby-t
    #Ruby #Rails #FactoryBot #Factories #Fixtures