Sha256: 0bf5a73639cd53304ddeef4427cde3b497e8c48bef963c0ad8f9eace268e22b1
Contents?: true
Size: 689 Bytes
Versions: 62
Compression:
Stored size: 689 Bytes
Contents
require 'test_helper' class EmailValidatorTest < Workarea::TestCase class FooModel include ActiveModel::Validations attr_accessor :email end def test_validate_each validator = EmailValidator.new(attributes: { foo: 'bar' }) model = FooModel.new validator.validate_each(model, :email, 'mdalton-test@workarea.com') assert(model.errors.empty?) validator.validate_each(model, :email, 'mdalton-test@foo.workarea.com') assert(model.errors.empty?) validator.validate_each(model, :email, 'mdalton-test') assert(model.errors.present?) validator.validate_each(model, :email, 'mdalton-test@workarea') assert(model.errors.present?) end end
Version data entries
62 entries across 62 versions & 1 rubygems