Merge pull request #217 from guillegiu/master
Synchronize backend title lenght validator
This commit is contained in:
commit
38d7474ef5
|
@ -298,7 +298,7 @@ export default {
|
||||||
'ERROR_EMPTY': 'Valor inválido',
|
'ERROR_EMPTY': 'Valor inválido',
|
||||||
'ERROR_PASSWORD': 'Contraseña Incorrecta',
|
'ERROR_PASSWORD': 'Contraseña Incorrecta',
|
||||||
'ERROR_NAME': 'Nombre Incorrecto',
|
'ERROR_NAME': 'Nombre Incorrecto',
|
||||||
'ERROR_TITLE': 'Título Incorreceto',
|
'ERROR_TITLE': 'Título Incorrecto',
|
||||||
'ERROR_EMAIL': 'Email inválido',
|
'ERROR_EMAIL': 'Email inválido',
|
||||||
'ERROR_CONTENT_SHORT': 'Contenido demasiado corto',
|
'ERROR_CONTENT_SHORT': 'Contenido demasiado corto',
|
||||||
'PASSWORD_NOT_MATCH': 'Las contraseñas no coinciden',
|
'PASSWORD_NOT_MATCH': 'Las contraseñas no coinciden',
|
||||||
|
|
|
@ -51,7 +51,7 @@ class CreateController extends Controller {
|
||||||
'permission' => 'user',
|
'permission' => 'user',
|
||||||
'requestData' => [
|
'requestData' => [
|
||||||
'title' => [
|
'title' => [
|
||||||
'validation' => DataValidator::length(10, 200),
|
'validation' => DataValidator::length(1, 200),
|
||||||
'error' => ERRORS::INVALID_TITLE
|
'error' => ERRORS::INVALID_TITLE
|
||||||
],
|
],
|
||||||
'content' => [
|
'content' => [
|
||||||
|
|
|
@ -16,20 +16,6 @@ describe '/ticket/create' do
|
||||||
(result['message']).should.equal('NO_PERMISSION')
|
(result['message']).should.equal('NO_PERMISSION')
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should fail if title is too short' do
|
|
||||||
result = request('/ticket/create', {
|
|
||||||
title: 'GG',
|
|
||||||
departmentId: 1,
|
|
||||||
language: 'en',
|
|
||||||
csrf_userid: $csrf_userid,
|
|
||||||
csrf_token: $csrf_token
|
|
||||||
})
|
|
||||||
|
|
||||||
(result['status']).should.equal('fail')
|
|
||||||
(result['message']).should.equal('INVALID_TITLE')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should fail if title is very long' do
|
it 'should fail if title is very long' do
|
||||||
long_text = ''
|
long_text = ''
|
||||||
300.times {long_text << 'a'}
|
300.times {long_text << 'a'}
|
||||||
|
|
Loading…
Reference in New Issue