Rabl.reset_source_cache! + Spork #373

agibralter opened this Issue Dec 7, 2012 · 1 comment


None yet
3 participants

For the life of me, I cannot figure out why the follow behavior is happening for me.

I have Rabl.configuration.cache_sources set to true for my test environment. I'm using Spork and RSpec, and I thought that I would need to include Rabl.reset_source_cache! in my Spork.each_run block because I assumed the source cache would mean my changes in rabl templates would not be reflected when spork runs my tests; however, when I put debugger statements in Rabl.source_cache, I find that before or after each run, the @_source_cache variable is reset to nil. I can verify that the @_configuration object stays the same, but for some reason, @_source_cache is being set to nil before each test without me calling Rabl.reset_source_cache!. Does anyone know how this is possible?


databyte commented Dec 20, 2012

I have cache_sources set to false personally - even it test. Because with RSpec, it won't load up a template unless you call render_views. That's the key difference between a unit test (model, controller, lib, etc) and an integration test (view, rabl). You don't always need to render the views in order to test logic.

nesquena closed this Dec 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment