Sha256: 5129ed77e3201d130d423b6e0c9b3cdb119ebfe6a597d60b2a25b68b6c946ea7

Contents?: true

Size: 509 Bytes

Versions: 62

Compression:

Stored size: 509 Bytes

Contents

require 'test_helper'

class ParameterValidatorTest < Workarea::TestCase
  class FooModel
    include ActiveModel::Validations
  end

  def test_validate_each
    validator = ParameterValidator.new(attributes: { foo: 'bar' })
    model = FooModel.new

    string = (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).join + '-_'
    validator.validate_each(model, :string, string)
    assert(model.errors.empty?)

    validator.validate_each(model, :string, ' &#.?')
    assert(model.errors.present?)
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.4.27 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.5.4 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.26 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.5.3 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.25 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.5.2 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.24 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.5.1 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.23 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.22 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.5.0 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.21 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.5.0.beta.1 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.20 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.19 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.18 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.17 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.16 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.15 test/lib/workarea/validators/parameter_validator_test.rb
workarea-core-3.4.14 test/lib/workarea/validators/parameter_validator_test.rb