I’m trying to understand what belongs – and what doesn’t belong – in
controller tests and in integration tests.
As a common example, assume I have a list of named widgets. Somewhere
in my code, I want to verify that
widget = FactoryGirl.create(:widget)
get :index
generates a page that has the string #{widget.name} somewhere therein.
But is that a controller test or an integration test?
As another example, assume a user must be logged on in order to access
the widgets. I can test authentication and authorization separately,
but is it considered necessary to write an integration test for this?
Or is this something you’d verify in a controller test?
Etc. I’m not looking for specific answers to the above as much as
guiding principles, or at least pointers to same. Thanks!