[rspec-users] Drawing the line between controller and integration tests

Fearless Fool lists at ruby-forum.com
Mon Sep 10 21:51:51 UTC 2012


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 at the controller level?

Etc.  I'm not looking for specific answers to the above as much as
guiding principles, or at least pointers to same.  Thanks!

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list