2016-10-15 02:59:11 +02:00
|
|
|
describe '/staff/get-tickets' do
|
|
|
|
request('/user/logout')
|
|
|
|
Scripts.login($staff[:email], $staff[:password], true)
|
|
|
|
|
|
|
|
it 'should get ticket list' do
|
|
|
|
|
|
|
|
ticket = $database.getRow('ticket', 1 , 'id')
|
|
|
|
request('/staff/assign-ticket', {
|
|
|
|
ticketNumber: ticket['ticket_number'],
|
2018-11-16 00:33:08 +01:00
|
|
|
page: 1,
|
2016-10-15 02:59:11 +02:00
|
|
|
csrf_userid: $csrf_userid,
|
|
|
|
csrf_token: $csrf_token
|
|
|
|
})
|
|
|
|
ticket = $database.getRow('ticket', 2 , 'id')
|
|
|
|
request('/staff/assign-ticket', {
|
|
|
|
ticketNumber: ticket['ticket_number'],
|
2018-11-16 00:33:08 +01:00
|
|
|
page: 1,
|
2016-10-15 02:59:11 +02:00
|
|
|
csrf_userid: $csrf_userid,
|
|
|
|
csrf_token: $csrf_token
|
|
|
|
})
|
|
|
|
result = request('/staff/get-tickets', {
|
2018-11-16 00:33:08 +01:00
|
|
|
page: 1,
|
2016-10-15 02:59:11 +02:00
|
|
|
csrf_userid: $csrf_userid,
|
|
|
|
csrf_token: $csrf_token
|
|
|
|
})
|
|
|
|
|
|
|
|
(result['status']).should.equal('success')
|
2019-10-01 21:40:30 +02:00
|
|
|
(result['data']['tickets'].size).should.equal(9)
|
2016-10-15 02:59:11 +02:00
|
|
|
end
|
2018-07-19 23:09:54 +02:00
|
|
|
end
|