forked from External/greenlight
change sessions#new test to allow redirect
This commit is contained in:
parent
d80fd262bc
commit
43496a6cf1
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
class SessionsController < ApplicationController
|
class SessionsController < ApplicationController
|
||||||
|
|
||||||
skip_before_filter :verify_authenticity_token
|
skip_before_action :verify_authenticity_token
|
||||||
|
|
||||||
def new
|
def new
|
||||||
# If LDAP is enabled, just route to it instead.
|
# If LDAP is enabled, just route to it instead.
|
||||||
|
|
|
@ -8,8 +8,13 @@ class SessionsControllerTest < ActionController::TestCase
|
||||||
|
|
||||||
test "should get new" do
|
test "should get new" do
|
||||||
get :new
|
get :new
|
||||||
|
# We redirect directly to LDAP if configured.
|
||||||
|
if ENV['LDAP_SERVER'].present?
|
||||||
|
assert_response :redirect
|
||||||
|
else
|
||||||
assert_response :success
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test "should redirect to home on auth failture" do
|
test "should redirect to home on auth failture" do
|
||||||
get "auth_failure"
|
get "auth_failure"
|
||||||
|
|
Loading…
Reference in New Issue