FactoryGirl
困ったのでメモ。 次のようなSTIな感じのモデルがあるとき、ファクトリ側でも継承を使いたいなーと思うわけです。 モデル class Post < ActiveRecord::Base end class PhotoPost < Post belongs_to :album end Factory FactoryGirl.define do factory :post …
困ったのでメモ。 次のようなSTIな感じのモデルがあるとき、ファクトリ側でも継承を使いたいなーと思うわけです。 モデル class Post < ActiveRecord::Base end class PhotoPost < Post belongs_to :album end Factory FactoryGirl.define do factory :post …