Hi Aaron,

Thanks for reply.
It was me asking you recently on github regarding your book actually. :)

I agree I need to practice.
As I understood, I can test same things in models and feature specs, so I'm
wondering which is better? which is effective?
I think this is main point beginners confuse.

Regards,
Askar

On Wed, Jul 29, 2015 at 5:14 AM, Aaron Sumner <[email protected]> wrote:

> 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/CAP4%3DRx_zhosmRtOBSnKxvT%3DUeHziEhnNB2eN0doQ56Z%2BeWe%2BRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to