[DEV-332] Create ruby tests for the new page size parameter (#1196)

This commit is contained in:
Joel Elias Méndez 2022-05-16 13:45:12 -03:00 committed by GitHub
parent 3720baf370
commit 93fa9e12a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 0 deletions

View File

@ -649,4 +649,33 @@ describe '/ticket/search' do
end
end
end
it 'should success if the page size is valid' do
pageSizeList = [5, 10, 20, 50]
for pageSize in pageSizeList
result = request('/ticket/search', {
csrf_userid: $csrf_userid,
csrf_token: $csrf_token,
page: 1,
pageSize: pageSize
})
(result['status'].should.equal('success'))
end
end
it 'should fail if page size is not among validation options' do
pageSizeList = [0, 51, 'string', true]
for pageSize in pageSizeList
result = request('/ticket/search', {
csrf_userid: $csrf_userid,
csrf_token: $csrf_token,
page: 1,
pageSize: pageSize
})
(result['status'].should.equal('fail'))
(result['message']).should.equal('INVALID_PAGE_SIZE')
end
end
end