From 001243986195143c395a9811d8254bbf1b9ebfa1 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 22 Jan 2020 09:08:39 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/lib/gitlab/auth/ldap/user_spec.rb | 12 ++++++++++++ spec/lib/gitlab/auth/o_auth/user_spec.rb | 14 ++++++++++++++ spec/lib/gitlab/auth/saml/user_spec.rb | 12 ++++++++++++ 3 files changed, 38 insertions(+) (limited to 'spec/lib/gitlab/auth') diff --git a/spec/lib/gitlab/auth/ldap/user_spec.rb b/spec/lib/gitlab/auth/ldap/user_spec.rb index bc09de7b525..071d687b2bf 100644 --- a/spec/lib/gitlab/auth/ldap/user_spec.rb +++ b/spec/lib/gitlab/auth/ldap/user_spec.rb @@ -139,6 +139,18 @@ describe Gitlab::Auth::LDAP::User do expect(gl_user).to be_confirmed end end + + context 'when the current minimum password length is different from the default minimum password length' do + before do + stub_application_setting minimum_password_length: 21 + end + + it 'creates the user' do + ldap_user.save + + expect(gl_user).to be_persisted + end + end end describe 'updating email' do diff --git a/spec/lib/gitlab/auth/o_auth/user_spec.rb b/spec/lib/gitlab/auth/o_auth/user_spec.rb index c621c0aa935..022a544395e 100644 --- a/spec/lib/gitlab/auth/o_auth/user_spec.rb +++ b/spec/lib/gitlab/auth/o_auth/user_spec.rb @@ -86,6 +86,20 @@ describe Gitlab::Auth::OAuth::User do end end + context 'when the current minimum password length is different from the default minimum password length' do + before do + stub_application_setting minimum_password_length: 21 + end + + it 'creates the user' do + stub_omniauth_config(allow_single_sign_on: [provider]) + + oauth_user.save + + expect(gl_user).to be_persisted + end + end + it 'marks user as having password_automatically_set' do stub_omniauth_config(allow_single_sign_on: [provider], external_providers: [provider]) diff --git a/spec/lib/gitlab/auth/saml/user_spec.rb b/spec/lib/gitlab/auth/saml/user_spec.rb index 5546438b7ee..4c400636ddf 100644 --- a/spec/lib/gitlab/auth/saml/user_spec.rb +++ b/spec/lib/gitlab/auth/saml/user_spec.rb @@ -325,6 +325,18 @@ describe Gitlab::Auth::Saml::User do expect(gl_user).to be_confirmed end end + + context 'when the current minimum password length is different from the default minimum password length' do + before do + stub_application_setting minimum_password_length: 21 + end + + it 'creates the user' do + saml_user.save + + expect(gl_user).to be_persisted + end + end end describe 'blocking' do -- cgit v1.2.3