- Avoid using
let
andlet!
They usually make you shared the thing across multiple tests. Result in convoluted tests and mystery guest.
- Separate testing phases with newlines.
Keep this consistently make your tests much easier to read.
-
Use RSpec's expect syntax
-
Use
describe
,context
,it
-
Prefer
not_to
overto_not
-
Use
have_css
,have_text
with Capybara -
Avoid using shared_examples
Which line it was testing will become hard to tell.
- Use More Ruby, less RSpec