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:
		
							parent
							
								
									9ccae7feff
								
							
						
					
					
						commit
						7e8733a518
					
				
					 2 changed files with 42 additions and 44 deletions
				
			
		| 
						 | 
					@ -3,7 +3,3 @@ NODE_ENV=test
 | 
				
			||||||
# Federation
 | 
					# Federation
 | 
				
			||||||
LOCAL_DOMAIN=cb6e6126.ngrok.io
 | 
					LOCAL_DOMAIN=cb6e6126.ngrok.io
 | 
				
			||||||
LOCAL_HTTPS=true
 | 
					LOCAL_HTTPS=true
 | 
				
			||||||
# test pam authentication
 | 
					 | 
				
			||||||
PAM_ENABLED=true
 | 
					 | 
				
			||||||
PAM_DEFAULT_SERVICE=pam_test
 | 
					 | 
				
			||||||
PAM_CONTROLLED_SERVICE=pam_test_controlled
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,6 +55,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
 | 
				
			||||||
      request.env['devise.mapping'] = Devise.mappings[:user]
 | 
					      request.env['devise.mapping'] = Devise.mappings[:user]
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ENV['PAM_ENABLED'] == 'true'
 | 
				
			||||||
      context 'using PAM authentication' do
 | 
					      context 'using PAM authentication' do
 | 
				
			||||||
        context 'using a valid password' do
 | 
					        context 'using a valid password' do
 | 
				
			||||||
          before do
 | 
					          before do
 | 
				
			||||||
| 
						 | 
					@ -105,6 +106,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
 | 
				
			||||||
          end
 | 
					          end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    context 'using password authentication' do
 | 
					    context 'using password authentication' do
 | 
				
			||||||
      let(:user) { Fabricate(:user, email: 'foo@bar.com', password: 'abcdefgh') }
 | 
					      let(:user) { Fabricate(:user, email: 'foo@bar.com', password: 'abcdefgh') }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue