diff options
-rw-r--r-- | activemodel/lib/active_model/validations/validates.rb | 4 | ||||
-rw-r--r-- | railties/guides/source/testing.textile | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/validations/validates.rb b/activemodel/lib/active_model/validations/validates.rb index 3242e49269..f6349d57a5 100644 --- a/activemodel/lib/active_model/validations/validates.rb +++ b/activemodel/lib/active_model/validations/validates.rb @@ -28,7 +28,7 @@ module ActiveModel # class EmailValidator < ActiveModel::EachValidator # def validate_each(record, attribute, value) # record.errors[attribute] << (options[:message] || "is not an email") unless - # value =~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i + # value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i # end # end # @@ -48,7 +48,7 @@ module ActiveModel # # class TitleValidator < ActiveModel::EachValidator # def validate_each(record, attribute, value) - # record.errors[attribute] << "must start with 'the'" unless =~ /^the/i + # record.errors[attribute] << "must start with 'the'" unless value =~ /\Athe/i # end # end # diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile index 69695c93c8..6686dc3290 100644 --- a/railties/guides/source/testing.textile +++ b/railties/guides/source/testing.textile @@ -735,7 +735,7 @@ You don't need to set up and run your tests by hand on a test-by-test basis. Rai |+rake test:plugins+ |Run all the plugin tests from +vendor/plugins/*/**/test+ (or specify with +PLUGIN=_name_+)| |+rake test:profile+ |Profile the performance tests| |+rake test:recent+ |Tests recent changes| -|+rake test:uncommitted+ |Runs all the tests which are uncommitted. Only supports Subversion| +|+rake test:uncommitted+ |Runs all the tests which are uncommitted. Supports Subversion and Git| |+rake test:units+ |Runs all the unit tests from +test/unit+| |