I've finally gotten a handle on rails, and feel comfortable enough with it to start learning best practices, with the first on my list being TDD principles. What are the best resources to learn about TDD with Rails? Books, tutorials, anything. I'm hungry to learn!
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
相关文章
- Ruby using wrong version of openssl
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
If you want to buy a book, I would suggest you to look at pragmatic rails test prescriptions . It's not stuck with an implementation as the rspec book is and will more probably let you choose the tools YOU want.
I feel it is also better to read this book than million posts where pro/con BDD/TDD are spinning around ;)
I would suggest you focus on the basics here! Don't fall in love with any specific way of doing TDD like rspec, shoulda or similar. Wait with that part until you understand the basics of rails TDD - THEN you can go out and add testing tools to your toolbox.
Start by writing a simple test for some part of your app where the logic does something else than CRUD work, some place where you handle some kind of math, or weird user behavior and try to write a test for that case - but make sure you have the time for it, because it will require much more time than expected the first time.
Once you have that test case running and working - and you fully understand why, then your ready to expand and start to play with all the wonderful testing tools out there.
My usual answer involving Rails and learning usually ends up at Railscasts. Check out the testing section. While there's not one specifically on TDD, most of them touch on the subject. Especially Cucumber, etc.
Have a look at this one: http://pragprog.com/titles/achbd/the-rspec-book