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

and use 'if' option of context block
lolsob-rspec
takayamaki 2018-10-21 00:28:04 +09:00 committed by Eugen Rochko
parent 40d23fc4d1
commit 17229858c8
2 changed files with 43 additions and 42 deletions

View File

@ -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

View File

@ -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') }