You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mike Burns edited this page Apr 14, 2023
·
1 revision
In features/support/env.rb:
World(FactoryBot::Syntax::Methods)
FactoryBot::Syntax::Methods
Including FactoryBot::Syntax::Methods gives you access to build, build_list, create, create_list, and attributes_for directly in your tests, such as:
Given("a user with {int} articles")do |num_articles|
@user=create(:user,articles: build_list(:article,num_articles))# not FactoryBot.create or FactoryBot.build_listend