Do controllers need unit tests if they're covered by integration test?

I usually skip unit tests for controllers when they’re covered by integration tests.

One exception is that I’ll sometimes test things like “make sure logged-out users can’t see this”, or “make sure a user can’t see another user’s private messages” with controller tests. It’s sometimes easier to test them directly this way, rather than exercising the whole app stack.

5 Likes