After reading up on rspec 2 and capybara 2 I'm slightly confused regarding best practices as far as structural directory layout is concerned. There seems to be some overlap between the various specs (such as request specs and controller specs for instance), and I was wondering what is the "best practice" way of organising these files, and what should each spec test?
What I've gathered so far (which may be wrong) is the following:
spec/factories
Factories used by Factory Girl (if used)
spec/features
Capybara tests, which emulate the interaction between a user and your application.
spec/models
Tests for model validation
spec/controllers
Testing controller actions (#new, #edit, #create etc.)
spec/requests
Tests for integration between various controllers (one level 'higher' than controller specs)
spec/support
Files which define modules that could be useful to include in some of the specs.
spec/acceptance
Acceptance tests.
spec/views
Tests concerned with whether views were rendered correctly
I personally feel that for instance spec/views
seems unnecessary in the sense that the capybara tests also are concerned with views (and how they look) and controller tests could easily also test whether or not a certain view is rendered.
What are your thoughts?