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:
parent
d05a9a3c4c
commit
6caa2abb56
1 changed files with 9 additions and 0 deletions
|
@ -28,6 +28,15 @@ describe FactoryBot::Registry do
|
||||||
.to raise_error(KeyError, "Great thing not registered: \"object_name\"")
|
.to raise_error(KeyError, "Great thing not registered: \"object_name\"")
|
||||||
end
|
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
|
it "adds and returns the object registered" do
|
||||||
registry = FactoryBot::Registry.new("Great thing")
|
registry = FactoryBot::Registry.new("Great thing")
|
||||||
registered_object = double("registered object")
|
registered_object = double("registered object")
|
||||||
|
|
Loading…
Reference in a new issue