Hi Alex,

I thought we should follow DRY concept so that I won't test one thing in
more than one method...

By "unit test", do you mean the default test of Rails?

Thanks,
Askar

On Thu, Jul 30, 2015 at 1:19 AM, Alex Chaffee <[email protected]> wrote:

> On Tue, Jul 28, 2015 at 8:06 PM, Askar Karasaev
> <[email protected]> wrote:
> > As I understood, I can test same things in models and feature specs, so
> I'm
> > wondering which is better? which is effective?
>
> Both.
>
> If I understand correctly, feature specs use Capybara which takes a
> relatively high-level pass through the app. It tests user input, HTML
> output, error handling, that sort of thing. Model specs are focused on
> a single object, so they test a wider range of scenarios, call
> individual methods, require much less setup, are faster, etc.
>
> I recommend a pyramid of test coverage: the base is unit tests
> (including model specs) -- make lots of those, fewer controller tests,
> and even fewer integration tests (including capybara).
>
>  - A
>
> --
> Alex Chaffee - [email protected]
> http://alexchaffee.com
> http://codelikethis.com
> http://twitter.com/alexch
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "rspec" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/rspec/FJcS2697KHA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAMf%3DvNoQXZYeOG2R0TmMQzNGXrS2jGDYghnM4XdWO%3D6qcmFeVw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-hNe%3Dg3VXiqrFBvmwZ4Wj3rOMcELtjr4OVe5ntkBkC1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to