Synchronize beckend title lenght validator

This commit is contained in:
Guillermo 2018-06-01 22:48:08 -03:00
parent 1903ea5757
commit 9c8052439c
3 changed files with 2 additions and 16 deletions

View File

@ -298,7 +298,7 @@ export default {
'ERROR_EMPTY': 'Valor inválido',
'ERROR_PASSWORD': 'Contraseña Incorrecta',
'ERROR_NAME': 'Nombre Incorrecto',
'ERROR_TITLE': 'Título Incorreceto',
'ERROR_TITLE': 'Título Incorrecto',
'ERROR_EMAIL': 'Email inválido',
'ERROR_CONTENT_SHORT': 'Contenido demasiado corto',
'PASSWORD_NOT_MATCH': 'Las contraseñas no coinciden',

View File

@ -51,7 +51,7 @@ class CreateController extends Controller {
'permission' => 'user',
'requestData' => [
'title' => [
'validation' => DataValidator::length(10, 200),
'validation' => DataValidator::length(1, 200),
'error' => ERRORS::INVALID_TITLE
],
'content' => [

View File

@ -16,20 +16,6 @@ describe '/ticket/create' do
(result['message']).should.equal('NO_PERMISSION')
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
long_text = ''
300.times {long_text << 'a'}