Should native validations be tested in rails?

前端 未结 5 2616
醉梦人生
醉梦人生 2021-02-20 07:25

Everybody knows that automated testing is a good thing.

Not everybody knows exacly what to test.

My question is if native validations like validate_presence_of,

5条回答
  •  广开言路
    2021-02-20 08:14

    Are you planning to write unit tests for every single Ruby operator and API method as well?

    Your unit tests should test your own code, not other people's - that's their job, why duplicate their work? And if you don't trust them to do their job well, why are you using their code?

提交回复
热议问题