2016-01-06 02:38:52 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Admin::IdentitiesController do
|
|
|
|
let(:admin) { create(:admin) }
|
2017-06-14 14:18:56 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(admin)
|
|
|
|
end
|
2016-01-06 02:38:52 -05:00
|
|
|
|
|
|
|
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
|