diff options
author | Gabriel Mazetto <gabriel@gitlab.com> | 2016-01-06 05:38:52 -0200 |
---|---|---|
committer | Gabriel Mazetto <gabriel@gitlab.com> | 2016-01-08 16:26:04 -0200 |
commit | ec67e9be1d7486199b47e19c766202a8bfdefe93 (patch) | |
tree | 2499ddcd631bb0935b77d510a6a137ba4b2b1ac4 /spec/controllers | |
parent | d6dc088affeee4568e771e1d7894e0bcdb955af8 (diff) | |
download | gitlab-ce-ec67e9be1d7486199b47e19c766202a8bfdefe93.tar.gz |
Repair ldap_blocked state when no ldap identity exist anymore
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/admin/identities_controller_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/controllers/admin/identities_controller_spec.rb b/spec/controllers/admin/identities_controller_spec.rb new file mode 100644 index 00000000000..c131d22a30a --- /dev/null +++ b/spec/controllers/admin/identities_controller_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe Admin::IdentitiesController do + let(:admin) { create(:admin) } + before { sign_in(admin) } + + describe 'UPDATE identity' do + let(:user) { create(:omniauth_user, provider: 'ldapmain', extern_uid: 'uid=myuser,ou=people,dc=example,dc=com') } + + it 'repairs ldap blocks' do + expect_any_instance_of(RepairLdapBlockedUserService).to receive(:execute) + + put :update, user_id: user.username, id: user.ldap_identity.id, identity: { provider: 'twitter' } + end + end + + describe 'DELETE identity' do + let(:user) { create(:omniauth_user, provider: 'ldapmain', extern_uid: 'uid=myuser,ou=people,dc=example,dc=com') } + + it 'repairs ldap blocks' do + expect_any_instance_of(RepairLdapBlockedUserService).to receive(:execute) + + delete :destroy, user_id: user.username, id: user.ldap_identity.id + end + end +end |