Using shoulda to refactor rspec tests on Rails models

前端 未结 5 2278
闹比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:35

    Lower testing levels' requirements mostly come from within your organization (internal docs), customer mostly provides only the customer requirement spec (let's say this is the highest level in testing V-model). As your organization starts design the sw creates the lower test levels specs step by step.

    For the "do we really need this" question: it depends on many things: the app complexity, safety critical or not, standards to follow, contractual/legal/industrial regulations, etc.

    In generally I would say, for a correct ideal application reqirement responsible for unit testing should write the unit level spec and tester should implement test based on this spec.

    For "have_many and respond_to" I am afraid I have no background info how they are implemented, so can not answer.

提交回复
热议问题