mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
* fix ticketEventId submit * staff allow manage ticket feature * edit-comment log * fix staff1/2 change own perfile pic * Makes frontend allow ticket editing for any staff member * Allows all staff members in charge of the department of a ticket to manage it (change its department, priority, comment on it, etc.) * fix comments github pt1 * tests ruby * fix * Fix ruby tests * add commenteed tests
37 lines
1.1 KiB
Ruby
37 lines
1.1 KiB
Ruby
describe'/staff/delete' do
|
|
request('/user/logout')
|
|
Scripts.login($staff[:email], $staff[:password], true)
|
|
@staffId = $database.getRow('staff','littlelannister@opensupports.com','email')['id']
|
|
|
|
it 'should delete staff member' do
|
|
result= request('/staff/delete', {
|
|
csrf_userid: $csrf_userid,
|
|
csrf_token: $csrf_token,
|
|
staffId: @staffId
|
|
})
|
|
|
|
(result['status']).should.equal('success')
|
|
|
|
row = $database.getRow('staff', @staffId, 'id')
|
|
(row).should.equal(nil)
|
|
|
|
row = $database.getRow('department', 1, 'id')
|
|
(row['owners']).should.equal('4')
|
|
|
|
end
|
|
|
|
it 'should fail delete if staff member is does not exist' do
|
|
result = request('/staff/delete', {
|
|
csrf_userid: $csrf_userid,
|
|
csrf_token: $csrf_token,
|
|
staffId: @staffId
|
|
})
|
|
|
|
(result['status']).should.equal('fail')
|
|
(result['message']).should.equal('INVALID_STAFF')
|
|
|
|
row = $database.getRow('department', 1, 'id')
|
|
(row['owners']).should.equal('4')
|
|
end
|
|
end
|