Created
December 3, 2012 18:52
-
-
Save acidlabs-snippets/4197074 to your computer and use it in GitHub Desktop.
Rspec Devise - Sign In User
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/spec_helper.rb | |
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |
# spec/support/devise.rb | |
RSpec.configure do |config| | |
config.include Devise::TestHelpers, type: :controller | |
end | |
# spec/controllers/whatever/controller/that/needs/authentication.rb | |
before :each do | |
sign_in user | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment