The ProblemIf you have watched this video: https://www.youtube.com/watch?v=PJjHfa5yxlU you will see around 30 mins mark, the code that looks like this:
This test does not test anything. She has stubbed her test, so it is meaningless. The test proves that a double class you created returns 47 in the assertion. You should never stub yourself out in a test. State based testing in this case is not the right choice. You can also pass junk values for the starting and ending values, the test will still pass. You can even pass empty params, the test will still pass.
You want exactly one test to fail for any given bug. This test will fail if you change 47 to any other number, string, nil or anything else. The emphasis of the current test is not on whether the message to total was sent or not.
Tests that are not written with their role as specifications in mind can be very confusing to read. The difficulty in understranding what they are testing can greatly reduce the velocity at which a codebase can be changed. Nat Pryce and Steve Freeman "Are your tests really driving your development?"