diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 18:06:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 18:06:36 +0300 |
commit | 556c79d6cc3d7b24ecbba3a79f8432eb3fcf5c7e (patch) | |
tree | 93c84c603316cdee73ce85949ba70e29ef78af32 /spec/services/users | |
parent | bffcdf9bca11a4d43cc40e3f382f03088d36f7c6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/users')
-rw-r--r-- | spec/services/users/repair_ldap_blocked_service_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/services/users/repair_ldap_blocked_service_spec.rb b/spec/services/users/repair_ldap_blocked_service_spec.rb new file mode 100644 index 00000000000..0205b40bc97 --- /dev/null +++ b/spec/services/users/repair_ldap_blocked_service_spec.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Users::RepairLdapBlockedService do + let(:user) { create(:omniauth_user, provider: 'ldapmain', state: 'ldap_blocked') } + let(:identity) { user.ldap_identity } + subject(:service) { described_class.new(user) } + + describe '#execute' do + it 'changes to normal block after destroying last ldap identity' do + identity.destroy + service.execute + + expect(user.reload).not_to be_ldap_blocked + end + + it 'changes to normal block after changing last ldap identity to another provider' do + identity.update_attribute(:provider, 'twitter') + service.execute + + expect(user.reload).not_to be_ldap_blocked + end + end +end |