Guillermo Giuliana 63ef66198a Remove special functionality of "ticket assignment", other minor fixes (#587)
* 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
2019-10-01 16:40:30 -03:00

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