LoginSignup
11
11

More than 5 years have passed since last update.

rspecのFactoryGirlをrails c のコンソールで使う方法

Posted at

以下のコマンド実行

require 'factory_girl';include FactoryGirl::Syntax::Methods;FactoryGirl.reload

これでrspec上に記載している

create(:test_record)

を好きに呼び出せる

毎回spec/spec_helper.rbから3行コピペするの面倒なので、1行にまとめて自分用メモ

11
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11