diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-27 09:09:33 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-27 09:09:33 -0800 |
commit | 2fd981685121394823c354d72983c9631970e5e6 (patch) | |
tree | c72f98b072991ae85acb6d3cb90a08605adfbb05 /activemodel | |
parent | 578c94ad025cc25b04473fbce687a4991c6348ed (diff) | |
parent | f4d9ba0296d1a66fe0eaa17ee8aa32e618e053d1 (diff) | |
download | rails-2fd981685121394823c354d72983c9631970e5e6.tar.gz rails-2fd981685121394823c354d72983c9631970e5e6.tar.bz2 rails-2fd981685121394823c354d72983c9631970e5e6.zip |
Merge pull request #4709 from ask4prasath/refactor_validation_test
Removed unwanted intializer and replaced with ruby default collect method
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/test/cases/validations_test.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activemodel/test/cases/validations_test.rb b/activemodel/test/cases/validations_test.rb index ed4d8fcdca..fe5358a9d0 100644 --- a/activemodel/test/cases/validations_test.rb +++ b/activemodel/test/cases/validations_test.rb @@ -58,8 +58,7 @@ class ValidationsTest < ActiveModel::TestCase r = Reply.new r.valid? - errors = [] - r.errors.each {|attr, messages| errors << [attr.to_s, messages] } + errors = r.errors.collect {|attr, messages| [attr.to_s, messages]} assert errors.include?(["title", "is Empty"]) assert errors.include?(["content", "is Empty"]) |