1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

rspec + FactoryBot で Class名を省略して create や build を直接書く設定 ( #Rails )

Last updated at Posted at 2019-11-19

Factory_botの設定

spec/rails_helper.rb

RSpec.configure do |config|
  config.include FactoryBot::Syntax::Methods

end

これで

  • FactoryBot.create を create と書けるようになる
  • FactoryBot.build を build と書けるようになる
  • etc etc

RailsアプリへのRspecとFactory_botの導入手順 - Qiita

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?