Render user app in test env

This commit is contained in:
2015-01-13 11:59:12 +01:00
parent f11bf57854
commit b614eeeaef
3 changed files with 4 additions and 3 deletions
@@ -1,7 +1,7 @@
module Users
class ApplicationController < ::ApplicationController
before_action :allow_all_origins
before_action :user_authentication, :unless => ->(c){ %w(obtain_token).include?(c.action_name) } # , except: [:obtain_token, :index]
before_action :user_authentication, unless: ->(c){ %w(obtain_token).include?(c.action_name) } # , except: [:obtain_token, :index]
private
@@ -11,6 +11,7 @@ module Users
sign_in user if user
sign_out current_user if current_user && !user # Other token attempt of logged in user
else
return if Rails.env.test? and action_name == 'index'
authenticate_user!
end