1
0
Fork 0

Add GoodSmallTextValidator

This commit is contained in:
Alex Kotov 2019-09-30 16:44:24 +05:00
parent db94693868
commit 2f114c1651
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
class GoodSmallTextValidator < GoodTextValidator
class Validation < Validation
MIN = 1
MAX = 255
def perform
super
error! :too_short, count: MIN if value.to_s.length < MIN
error! :too_long, count: MAX if value.to_s.length > MAX
end
end
end

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe GoodSmallTextValidator do
pending "add some examples to (or delete) #{__FILE__}"
end