Fix broken tests

This commit is contained in:
Rafael Mendonça França 2012-01-11 18:19:11 -03:00
parent cc2ad0e283
commit 8d5dcfde43
2 changed files with 4 additions and 0 deletions

View File

@ -29,8 +29,11 @@ module SimpleForm
def has_tokenizer?(length_validator)
tokenizer = length_validator.options[:tokenizer]
# TODO: Remove this check when we drop Rails 3.0 support
if ActiveModel::Validations::LengthValidator.const_defined?(:DEFAULT_TOKENIZER)
tokenizer && tokenizer != ActiveModel::Validations::LengthValidator::DEFAULT_TOKENIZER
else
tokenizer
end
end
end

View File

@ -192,6 +192,7 @@ class OtherValidatingUser < User
validates_format_of :country, :with => /\w+/
# TODO: Remove this check when we drop Rails 3.0 support
if ActiveModel::VERSION::MAJOR == 3 && ActiveModel::VERSION::MINOR >= 1
validates_format_of :name, :with => Proc.new { /\w+/ }
else