Fix test to have file at Base64, fix size validation

This commit is contained in:
Alex Sherman 2021-03-19 15:35:55 +05:00
parent 31a463c587
commit 0f58e47513
4 changed files with 15 additions and 11 deletions

View file

@ -21,14 +21,19 @@ class LegalDocument < ApplicationRecord
def epp_code_map
{
'2306' => [
[:body, :length]
]
'2306' => [
%i[body length_more_than],
%i[body length_less_than],
]
}
end
def val_body_length
errors.add(:body, :length) if body.nil? || body.size < MIN_BODY_SIZE
if body.nil? || body.size < MIN_BODY_SIZE
errors.add(:body, :length_more_than)
elsif body.size > MAX_BODY_SIZE
errors.add(:body, :length_less_than)
end
end
def save_to_filesystem