fix: Execute PAM authentication tests on CircleCI (#9029)
and use 'if' option of context block
This commit is contained in:
parent
fd5285658f
commit
33976c8ecc
|
@ -13,6 +13,9 @@ aliases:
|
|||
ALLOW_NOPAM: true
|
||||
CONTINUOUS_INTEGRATION: true
|
||||
DISABLE_SIMPLECOV: true
|
||||
PAM_ENABLED: true
|
||||
PAM_DEFAULT_SERVICE: pam_test
|
||||
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
||||
working_directory: ~/projects/mastodon/
|
||||
|
||||
- &attach_workspace
|
||||
|
|
|
@ -55,8 +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 PAM authentication', if: ENV['PAM_ENABLED'] == 'true' do
|
||||
context 'using a valid password' do
|
||||
before do
|
||||
post :create, params: { user: { email: "pam_user1", password: '123456' } }
|
||||
|
@ -106,7 +105,6 @@ 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') }
|
||||
|
|
Loading…
Reference in New Issue