Permalink
Browse files

Merge pull request #16248 from zuhao/refactor_activerecord_presence_v…

…alidation_test

Remove the side-effects of validates_presence_of.
  • Loading branch information...
2 parents cee2c85 + 18cc712 commit fc7a849ce5da7239894013ba2493a1523165aa52 @senny senny committed Jul 22, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 activerecord/test/cases/validations/presence_validation_test.rb
@@ -52,14 +52,15 @@ def test_validates_presence_of_has_many_marked_for_destruction
end
def test_validates_presence_doesnt_convert_to_array
- Speedometer.validates_presence_of :dashboard
+ speedometer = Class.new(Speedometer)
+ speedometer.validates_presence_of :dashboard
dash = Dashboard.new
# dashboard has to_a method
def dash.to_a; ['(/)', '(\)']; end
- s = Speedometer.new
+ s = speedometer.new
s.dashboard = dash
assert_nothing_raised { s.valid? }

0 comments on commit fc7a849

Please sign in to comment.