I’m working on a Rails project and wanted to validate that the Devise User Registration path was working as I expected. A quick google search turned up Devise Integration Tests With rspec which was a good starting point, but there were a few things I wanted to change.

  • Break the test up to have only one assertion per block
  • Update to use RSpec 3 and the expect syntax
  • Use capybara-email methods for clicking email links

That led me to the code below.