1
0
Fork 0
forked from fedi/mastodon

Do not test PAM authentication by default (#9027)

* Do not test PAM authentication by default

* Disable PAM tests if PAM is not enabled
This commit is contained in:
Eugen Rochko 2018-10-20 07:32:26 +02:00 committed by GitHub
parent 9486f0ca77
commit d5bfba3262
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 44 deletions

View file

@ -3,7 +3,3 @@ NODE_ENV=test
# Federation
LOCAL_DOMAIN=cb6e6126.ngrok.io
LOCAL_HTTPS=true
# test pam authentication
PAM_ENABLED=true
PAM_DEFAULT_SERVICE=pam_test
PAM_CONTROLLED_SERVICE=pam_test_controlled

View file

@ -55,6 +55,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
request.env['devise.mapping'] = Devise.mappings[:user]
end
if ENV['PAM_ENABLED'] == 'true'
context 'using PAM authentication' do
context 'using a valid password' do
before do
@ -105,6 +106,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
end
end
end
end
context 'using password authentication' do
let(:user) { Fabricate(:user, email: 'foo@bar.com', password: 'abcdefgh') }