Testing with Devise

To create a fixture for a user record :

first:
  email: foo@bar.com
  encrypted_password: <%= Devise::Encryptor.digest(User, 's3cr3t') %>

As for the integration tests, to simulate a login, we need first to include the following module :

class ActionDispatch::IntegrationTest
  include Devise::Test::IntegrationHelpers
end

And then call :

sign_in users(:first)