fix: Execute PAM authentication tests on CircleCI (#9029)

and use 'if' option of context block
master
takayamaki 6 years ago committed by Eugen Rochko
parent fd5285658f
commit 33976c8ecc
  1. 3
      .circleci/config.yml
  2. 4
      spec/controllers/auth/sessions_controller_spec.rb

@ -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…
Cancel
Save