Hi all, I just converted one of our internal applications to use engines and am really impressed so far. I'm hoping you can help me clear up a bit of a problem I am having. I set up a new application using the engine and everything works great. The client requests that the user registration page collect the user's birthday. I write a test, create a migration, overwrite the user model to validate_presence_of :birth_date and everything works perfectly. Unfortunately when I run rake:test:plugins I get a bunch of test failures because the model is looking for birth_date. Is there a way to test your engine without loading up all of the things you are overwriting in the app directory? Thanks, Alex
on 2007-09-19 02:51
on 2007-09-24 11:32
In general, you can set Engines.disabled_application_code_loading = true to disable the code mixing features when you want to test your bare plugin controllers, etc. However, since the code mixing doesn't work (at the moment) with models, this probably wont help. The reason why your models are being loaded is simply because app/models is in the load path, so in your specific case, you might be able to get around it by removing that path from $LOAD_PATH. You could also add a Rakefile to your plugin which you can use to run the tests for your plugin without going through Rails - this would also isolate your code from anything in app. HTH, James
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.