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

Reply via email to