2 ms·
Hello. Thank you so much for the book and the pioneering model that you have published it with. All the best on the platform for distribution. Please don't t
by ambulancechaser 12y ago
Hello. Thank you so much for the book and the pioneering model that you have published it with. All the best on the platform for distribution.
Please don't take the advice to downplay rspec. I think in chapter 8 you update the User model. It was so incredibly nice that, having been a week or so since I was able to work on the project, I was confident that the introduced changes did not break any functionality of the app. It is very easy to not see the benefit of testing when learning, only to curse your luck when you look at code later.
I have recently read a good article using your test suite as an example of how to improve tests. The author criticized the terse nature of your tests, with subject and nested describes. He felt that you write once and read often, so there is great benefit to making the tests verbose. It is, in effect, a contract that any User model must satisfy to be a valid user model. Going DRY and code golf on it only helps to frustrate the person looking to acclimate themselves to a project rather than saving a few minutes during test creation.
Again all the best and thanks for the wonderful tutorial and interesting distribution network.
- mhartl 12y agoPlease don't take the advice to downplay rspec. I think you may be confusing RSpec with testing generally. The 3rd edition replaces RSpec with the default Rails testing framework (MiniTest), but it still develops a thorough test suite.