Marnen Laibow-Koser-2 wrote:
> 
> Of course, you can keep it in the ApplicatonController. That's what the 
> ApplicationController is for. I just wouldn't test the 
> ApplicationController itself cause it doesn't make sense to me and I 
> guess you're not supposed to test it anyway since there's no 
> application_test.rb or anything being created when you create a Rails 
> application :)
> I'd move the tests you have right now in your ApplicationController test 
> file to the UserController test or wherever you think it belongs to and 
> you should be fine.
> 

Yeah I guess that works, I've already exercised this code elsewhere its just
seems cleaner to me to have a test as close to the code its testing as
possible.  So when it eventually breaks in a few months time and I've
forgotten all about the fact that I couldn't test in the
ApplicationController I wont be looking in the UserController for the
problem.  I guess I can just drop a comment in stating that.  

Anyone know if it was a deliberate design decision not to test the
ApplicationController or if there was a reason it couldn't be done?  Or even
better if there's a way to test it?

-- 
View this message in context: 
http://old.nabble.com/Finding-it-difficult-to-test-a-before_filter-on-my-ApplicationController-tp28253771p28254234.html
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to