Using shoulda to refactor rspec tests on Rails models

前端 未结 5 2291
闹比i
闹比i 2021-02-14 00:57

After learning about shoulda-matchers by answering another StackOverflow question on attribute accessibility tests (and thinking they were pretty awesome), I decided to try refa

5条回答
  •  广开言路
    2021-02-14 01:39

    I think this whole thing should be seen from specification point of view.

    If you have a component-testing-level specification which covers the necessary database columns for the given model, you should, otherwise not.

    If not covered, but as a responsible developer you feel it important to have (your sw and its quality characteristics are better that way), you have to arrange to include this info in the spec, then you can put these tests in the test suite.

提交回复
热议问题