我希望在更改工厂时,无需重新启动所有控制台,在rails控制台中即可查看更改。
我发现了一些代码行,并在对其理解不够充分的情况下进行了测试,文档对我来说并不清晰:
FactoryGirl.reload
我还进行了以下测试:
> FactoryGirl.factories.clear
> FactoryGirl.find_definitions # also tested FactoryGirl.factories.find_definitions
# but NoMethodError is raised
=> ActiveRecord::RecordNotFound: Couldn't find Address with ID=277 Torphy Squares
FactoryGirl.reload
。 - apneadiving