Sameer Siruguri

My Blog

Rails Adventure du Jour: Testing!

So I’ve started testing my code now, and delved a bit into the world of RSpec, Capybara and BDD.

This will take a while to figure out but here are two things I learned that aren’t really described anywhere in the most popular tutorials on Rails testing:

  1. All your spec files should end in _spec.rb
  2. It’s good to know what matchers and helpers to include – config.include Devise::TestHelpers, type: :controller inside the block of RSpec.config and require ‘cancan/matchers’ are two good ones to add, if you have authentication and authorization going on with your app.

Single Post Navigation

Leave a Reply

Your email address will not be published. Required fields are marked *