Merge pull request #217 from guillegiu/master

Synchronize backend title lenght validator
This commit is contained in:
Guillermo Giuliana 2018-06-06 02:37:43 -03:00 committed by GitHub
commit 38d7474ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 16 deletions

View File

@ -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',

View File

@ -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' => [

View File

@ -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'}