Permalink
Browse files

Work in test env also (for quick integration testing)

  • Loading branch information...
divineforest committed Oct 6, 2011
1 parent c6ec96b commit 1a30bbe5c9d660916a0301812b412269583bb591
Showing with 6 additions and 2 deletions.
  1. +4 −0 README.textile
  2. +2 −2 app/controllers/dev_log_in_controller.rb
View
@@ -10,5 +10,9 @@ h1. Why?
Helps you to log in and easily switch between multiple users in development env.
+h1. Installation
+
+gem 'dev_log_in'
+
Copyright (c) 2011 divineforest, evrone
This project rocks and uses MIT-LICENSE.
@@ -1,11 +1,11 @@
class DevLogInController < ApplicationController
def log_in
- if Rails.env.development?
+ if Rails.env.development? || Rails.env.test?
user = User.where(["email LIKE ?", params[:login]+'%']).first || (raise "Can't find user '#{params[:login]}'")
sign_in_and_redirect(user)
else
- raise "Works only development env"
+ raise "Works only in development or test env"
end
end

0 comments on commit 1a30bbe

Please sign in to comment.