Last Updated: February 25, 2016
·
1.868K
· shageman

Achieving better structure for rspec feature specs through "by" and "and_by" blocks

If you find that you are making your rspec feature specs longer and longer to cram more coverage in or to prevent the setup costs for more, shorter tests, you will probably have found that it becomes very hard to figure out what's going on. If you find yourself wanting to add comments to your specs to state what is happening, consider instead introducing blocks to structure you test:

http://pivotallabs.com/getting-by-with-rspec-feature-specs/