2022-04-26から1日間の記事一覧
テストの書き方で疑問だった箇所とその理由 describe '検索機能' do let(:article_with_author) { create(:article, :with_author, author_name: '田中') } let(:article_with_another_author) { create(:article, :with_author, author_name: '佐藤') } # …
FactoryBotにおけるアソシエーション belongs_toとhas_many ※ 解釈が合っているか分からない 所属(belongs_to)先を記載する場合はFactoryBotにassociation: author(associationは省略可)みたいに記載すればいい has_manyの場合はassociationによる記載が使え…