New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argument Error: Not registered using factory_girl 1.1.0 with rails 3.1.0.rc8 #194
Comments
Are the factories part of the engine or part of your tests for the engine? I'm not too sure I understand what you're trying to achieve here. |
Haha, thanks for the reply, joshuaclayton. I may well be the issue here! I have a models-only engine I want to use among three separate projects, so I only need model testing in the Engine, but I do want to have it there. My thinking was to use the Mountable Engine for this purpose. At this point I've pulled back from making it mountable as in this case I don't need the namespacing, and the magic-luggage with --mountable appears to have been causing me trouble. I was able to get around the issue with factory_girl, however, by putting the following in my spec_helper.rb. FactoryGirl.definition_file_paths << File.join(File.dirname(FILE), 'factories') It appears the default behavior was to point to factories down in /dummy, however, spec and the others seem to prefer having tests, etc. up in /spec. In the end it makes no difference to me, but I thought you guys would want to know there appears to be a divergence here with rspec using one structure and factory_girl using the other. Thanks again. |
What you ended up writing (adding the path to Factory Girl's |
In addition to this I found that I had to
|
I am working on a Mountable Engine in rails 3.1.0.rc8 and am getting "Argument Error: Not registered: user1" when I run factory_girl.
Reading #168, I see where you suggested the dev to run FactoryGirl.definition_file_paths from rails console. Suspecting the same issue, I tried this, and received:
=> ["/Users/mab/Documents/Development/mountable_engine_tests/gemmy/spec/dummy/test/factories", "/Users/mab/Documents/Development/mountable_engine_tests/gemmy/spec/dummy/spec/factories"]
Since this is a mountable engine, I had been putting the specs, fixtures, and everything in Users/mab/Documents/Development/mountable_engine_tests/gemmy/spec, WITHOUT the /dummy. So my factories are in Users/mab/Documents/Development/mountable_engine_tests/gemmy/spec/factories.
According to the docs I've been reading on mountable engines everywhere, the factories should not be under dummy. Can you advise?
TIA,
-Matt
Any advice on how to repair this?
The text was updated successfully, but these errors were encountered: