diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-22 12:08:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-22 12:08:39 +0300 |
commit | 001243986195143c395a9811d8254bbf1b9ebfa1 (patch) | |
tree | 6d6d665154fd38beea6ea7f8985330f956565bb3 /spec/lib/gitlab/auth | |
parent | 83d8c1d61762898eb4e69878f117cbb2ef5be494 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/auth')
-rw-r--r-- | spec/lib/gitlab/auth/ldap/user_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/gitlab/auth/o_auth/user_spec.rb | 14 | ||||
-rw-r--r-- | spec/lib/gitlab/auth/saml/user_spec.rb | 12 |
3 files changed, 38 insertions, 0 deletions
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 |