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! https://leanpub.com/everydayrailsrspec

Everyday Rails Testing with RSpec

Real-world advice for adding reliable tests to your Rails apps with RSpec. Learn to test with confidence!

Testing Rails Apps with FactoryBot and MiniTest

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: https://github.com/thoughtbot/factory_bot_rails#automatic-factory-definition-loading #rails #factorybot

GitHub - thoughtbot/factory_bot_rails: Factory Bot ♥ Rails

Factory Bot ♥ Rails. Contribute to thoughtbot/factory_bot_rails development by creating an account on GitHub.

GitHub
【RSpec】フレーキーなテスト(たまに落ちるテスト)の直し方 - Qiita

はじめに自動テストを整備しておくと大量のテストを自動実行してくれるので大変便利です。ですが、テストコードが増えてくると「パスするはずなのに、なぜかたまに失敗する」というテストが出てきます。この…

Qiita

@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 🐶
https://link.testdouble.com/new-ruby-test-data-gem
#Ruby #Rails #FactoryBot #Factories #Fixtures

The future of Rails test data management

A year ago, I created one of the most ambitious, creative, and potentially impactful libraries of my career… and I never told anyone about it. Here's why

Test Double

Leaving this here in case anyone is losing sleep over their lack of FactoryBot knowledge 🛌 😁

https://www.honeybadger.io/blog/factorybot-for-rails-testing-md/
#ruby #rails #factorybot

FactoryBot for Rails testing

Dive into FactoryBot to ensure your testing data is reliable and consistent.

Honeybadger Developer Blog
【初心者向け】Railsでテストコードを書くときにテストデータにidをベタ書きするのはやめよう
https://qiita.com/jnchito/items/6beb97e73934eb3e4dce?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items
#qiita #Ruby #Rails #RSpec #minitest #FactoryBot
【初心者向け】Railsでテストコードを書くときにテストデータにidをベタ書きするのはやめよう - Qiita

はじめに:idはベタ書きするな!テストコードを書くのに慣れていない初心者の方のコードレビューをしていると、次のような方法でテストデータを作っているのをよく見かけます。# これはNGなコードです!…

Qiita

Two weeks of open source updates from @thoughtbot right in your Monday feed. Includes details of a new version release of factory_bot!

https://thoughtbot.com/blog/this-week-in-open-source-sep-14-2023

#thoughtbot #ruby #openSource #factoryBot

This Week in Open Source (September 14, 2023)

Recent thoughtbot open source updates (September 14, 2023).

thoughtbot
... and here's the version with #FactoryBot ...