module FactoryBot::Syntax::Methods

This module is a container for all strategy methods provided by FactoryBot. This includes all the default strategies provided ({Methods#build}, {Methods#create}, {Methods#build_stubbed}, and {Methods#attributes_for}), as well as the complementary *_list and *_pair methods. @example singular factory execution

# basic use case
build(:completed_order)

# factory yielding its result to a block
create(:post) do |post|
  create(:comment, post: post)
end

# factory with attribute override
attributes_for(:post, title: "I love Ruby!")

# factory with traits and attribute override
build_stubbed(:user, :admin, :male, name: "John Doe")

@example multiple factory execution

# basic use case
build_list(:completed_order, 2)
create_list(:completed_order, 2)

# factory with attribute override
attributes_for_list(:post, 4, title: "I love Ruby!")

# factory with traits and attribute override
build_stubbed_list(:user, 15, :admin, :male, name: "John Doe")