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/keyed_by_class_spec.rb

18 lines
362 B
Ruby
Raw Permalink Normal View History

describe "finding factories keyed by class instead of symbol" do
before do
define_model("User") do
attr_accessor :name, :email
end
FactoryBot.define do
factory :user
end
end
it "doesn't find the factory" do
expect { FactoryBot.create(User) }.to(
raise_error(KeyError, /Factory not registered: User/)
)
end
end