2016-01-19 16:12:03 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Admin::IdentitiesController do
|
|
|
|
let(:admin) { create(:admin) }
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(admin)
|
|
|
|
end
|
2016-01-19 16:12:03 +05:30
|
|
|
|
|
|
|
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)
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
put :update, params: { user_id: user.username, id: user.ldap_identity.id, identity: { provider: 'twitter' } }
|
2016-01-19 16:12:03 +05:30
|
|
|
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)
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
delete :destroy, params: { user_id: user.username, id: user.ldap_identity.id }
|
2016-01-19 16:12:03 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|