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

Add back did_you_mean spec

This essentially reverts commit 3a4d6f48. We removed that test because
we couldn't get it passing on Ruby 2.3 and 2.4, but we have since
removed support for those versions of Ruby.
This commit is contained in:
Daniel Colson 2020-07-10 11:52:25 -04:00
parent d05a9a3c4c
commit 6caa2abb56

View file

@ -28,6 +28,15 @@ describe FactoryBot::Registry do
.to raise_error(KeyError, "Great thing not registered: \"object_name\"")
end
it "includes a did_you_mean message" do
registry = FactoryBot::Registry.new(:registry)
registered_object = double(:registered_object)
registry.register(:factory_bot, registered_object)
expect { registry.find(:factory_bit) }
.to raise_error(KeyError, /Did you mean\? "factory_bot"/)
end
it "adds and returns the object registered" do
registry = FactoryBot::Registry.new("Great thing")
registered_object = double("registered object")