Basically, if it has business logic that is non-trivial then it should be unit tested.
As you test the controller, if you have already tested lower levels, then you can mock out the lower levels so that your test will go quicker, but, everything should have a test, all the public and protected methods, not just the public ones, IMO.
manpreet
Best Answer
2 years ago
I want to understand exactly what unit test means.
From what I have understood so far it implies testing a model and all its public methods.
Is that correct?
And what about controllers? Does unit test means testing the controllers/views too?
Could someone enlighten me on this.