Skip to content
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

Rails caches views in test environment by default #4

Closed
eugenebolshakov opened this issue Jun 13, 2009 · 3 comments
Closed

Rails caches views in test environment by default #4

eugenebolshakov opened this issue Jun 13, 2009 · 3 comments
Labels

Comments

@eugenebolshakov
Copy link

And so changes you make in you views after spork is loaded are not hooked up.

config.action_view.cache_template_loading should be set to "false" in confing/environments/test.rb (and config/environments/cucumber.rb if you have that).

Maybe the instruction should be added to the README.

@eugenebolshakov
Copy link
Author

The setting is available in rails 2.3 http://bit.ly/Nnasy. AFAIK in earlier versions templates are eager loaded if config.cache_classes is set to "true", which is required to use cucumber http://bit.ly/Hrc57. So there does not seem to be an easy way to disable that for cucumber in rails < 2.3.

@timcharper
Copy link
Contributor

Thank you for reporting this, this is a very sensible default. Spork should definitely handle this out of the box - it already prevents the app from pre-loading.

@timcharper
Copy link
Contributor

I just released Spork 0.5.7 which addresses this issue.

See the link below:

http://github.com/timcharper/spork/blob/ce042d5e6dff676e0394cd4b5b28199a5700dea2/lib/spork/app_framework/rails.rb#L97

Basically, rather than forcing cache_classes to be false, or cache_template_loading to be false, I 'trapped' the method responsible for eager loading views so it would just be delayed until after the fork.

Tested and passed in rails 2.3.2, 2.2.2, 2.1.2, 2.0.5

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants