Merge pull request #1697 from okriuchykhin/ok_SCI_3264

Update limits for new rich text enabled fileds [SCI-3264]
This commit is contained in:
Alex Kriuchykhin 2019-04-25 23:54:05 +02:00 committed by GitHub
commit 6bb19ed0be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -12,7 +12,7 @@ class MyModule < ApplicationRecord
validates :name,
length: { minimum: Constants::NAME_MIN_LENGTH,
maximum: Constants::NAME_MAX_LENGTH }
validates :description, length: { maximum: Constants::TEXT_MAX_LENGTH }
validates :description, length: { maximum: Constants::RICH_TEXT_MAX_LENGTH }
validates :x, :y, :workflow_order, presence: true
validates :experiment, presence: true
validates :my_module_group, presence: true,

View file

@ -18,7 +18,7 @@ class Protocol < ApplicationRecord
auto_strip_attributes :name, :description, nullify: false
# Name is required when its actually specified (i.e. :in_repository? is true)
validates :name, length: { maximum: Constants::NAME_MAX_LENGTH }
validates :description, length: { maximum: Constants::TEXT_MAX_LENGTH }
validates :description, length: { maximum: Constants::RICH_TEXT_MAX_LENGTH }
validates :team, presence: true
validates :protocol_type, presence: true

View file

@ -67,7 +67,7 @@ describe MyModule, type: :model do
end
it do
should validate_length_of(:description)
.is_at_most(Constants::TEXT_MAX_LENGTH)
.is_at_most(Constants::RICH_TEXT_MAX_LENGTH)
end
end
end

View file

@ -48,7 +48,7 @@ describe Protocol, type: :model do
end
it do
should validate_length_of(:description)
.is_at_most(Constants::TEXT_MAX_LENGTH)
.is_at_most(Constants::RICH_TEXT_MAX_LENGTH)
end
end
describe '.archive(user)' do