1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/spec/acceptance/skip_create_spec.rb

18 lines
356 B
Ruby
Raw Permalink Normal View History

describe "skipping the default create" do
before do
define_model("User", email: :string)
FactoryBot.define do
factory :user do
skip_create
email { "john@example.com" }
end
end
end
it "doesn't execute anything when creating the instance" do
expect(FactoryBot.create(:user)).not_to be_persisted
end
end