8 ms·
I think tests should have caught that one but I agree.
by montblanc 5y ago
I think tests should have caught that one but I agree.
- henry700 5y agoNot if you follow the One True Way of Unit Testing (tm) where the Mongoid lib would have been mocked away, and the test would pass :) Integration tests might've done the job here.
- montblanc 5y agoYou dont mock the db layer, i dont do that at least, hell no. Let the db be hit, check that the records it returns make sense. Thats how I roll at least.
- henry700 5y agoDidn't want to aim at you with the reply, just remembered the collective delusion of 100% coverage unit testing zealots and how this would ironically fail to catch this. You'd be surprised how far people go to shoot themselves in the foot.