Better user specs for joining tables

This commit is contained in:
2013-12-09 10:01:06 +01:00
parent afb30556bd
commit 087cfa639d
15 changed files with 159 additions and 16 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
module Admin
class UsersController < Admin::ApplicationController
skip_before_filter :authenticate_administrator!, only: :test_login
skip_before_filter :set_locale, only: :test_login
# GET /users
# GET /users.json
def index
@@ -27,8 +28,10 @@ module Admin
def test_login
if Rails.env.test? and user = User.find_by_email(params[:email])
sign_in user
render layout: false
else
render nothing: true
end
render nothing: true
end
# GET /users/new
+1 -1
View File
@@ -24,7 +24,7 @@ private
end
def set_locale
I18n.locale = (params[:locale].presence || Rails.configuration.i18n.default_locale).to_sym
I18n.locale = (params[:locale].presence || I18n.default_locale).to_sym
end
def layout_by_resource