Permalink
Browse files

Merge pull request #4709 from ask4prasath/refactor_validation_test

Removed unwanted intializer and replaced with ruby default collect method
  • Loading branch information...
2 parents 578c94a + f4d9ba0 commit 2fd981685121394823c354d72983c9631970e5e6 @tenderlove tenderlove committed Jan 27, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 activemodel/test/cases/validations_test.rb
@@ -58,8 +58,7 @@ def test_single_error_per_attr_iteration
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"])

0 comments on commit 2fd9816

Please sign in to comment.