Hi Askar, this is Aaron from Everyday Rails. The posts you're referring to, and my book that followed them, were based on how I learned testing. I found testing models to be easier because they didn't require very much setup. Once I got comfortable testing models I moved up to more complex tests. Once I got comfortable with the process of writing tests, I switched to the "top down" approach that it sounds like Ryan covers in Rails 4 in Action. I start with a high level spec (like a feature spec), then I drop down to a lower level spec (like a model spec) when my tests aren't giving me good feedback about my code.
Wherever you start testing, I recommend practicing a lot. I would write tests for simple functionality, and functionality that I already knew was working. Then I would experiment to see happened when I changed things around in the test, and in the application code being tested. Deliberate practice and experimentation are the best ways I've found for learning testing and programming. Hope that helps, Aaron On Monday, July 27, 2015 at 11:42:40 PM UTC-5, Askar wrote: > > I'm very new to rspec. > > Can't figure out where to start writing specs from? > > In the Rails 4 in Action they starting from writing in *spec/features*. > In http://everydayrails.com/ they start from *spec/models*. > Not sure if there any other approach... > > Which approach is recommended? > -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/125a6d6e-1c41-447b-a8db-00d02ad7a2b2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
