Skip to content

Instantly share code, notes, and snippets.

@jstirk
Created January 23, 2013 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstirk/4601203 to your computer and use it in GitHub Desktop.
Save jstirk/4601203 to your computer and use it in GitHub Desktop.
Put these in spec/support/ , but not example_request_spec.rb
module AuthenticationHelpers
def log_in_as(model)
login_as(model)
end
end
RSpec.configure do |config|
config.include AuthenticationHelpers, :type => :request
config.include Devise::TestHelpers, :type => :controller
end
describe "My Account" do
context "as a logged in User" do
before(:each) do
log_in_as(user)
end
end
end
RSpec.configure do |config|
config.include Warden::Test::Helpers, :type => :request
config.before :each, :type => :request do
Warden.test_mode!
end
config.after :each, :type => :request do
Warden.test_reset!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment