Hi all. I’m using the ApplicationController to set a session variable
for all other controllers. It works.
However, when performing functional tests, it appears that calling a
controller doesn’t invoke its parent’s before_filter method.
I’ve tried, in my tests, calling ApplicationController’s methods
directly, but I either get weird errors (e.g. “using a symbol as an
array index session[:cart]”) or the variable assignments (session,
instance, whatever) don’t propagate to children controllers.
I can test my actual ApplicationController for correctness, but unless I
tell it to render(:nothing => true) (a big no-no if you use your
imagination) or put in an actual view for it to render I get an error
during testing saying it couldn’t render anything. I’d rather not have
random views (okay, 1 random view, but still) floating around just to
get a test to work.
Has anyone gotten around this? Thanks, much!