aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/validations_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/validations_test.rb')
-rw-r--r--activerecord/test/cases/validations_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb
index 2a5e683f96..9527404f03 100644
--- a/activerecord/test/cases/validations_test.rb
+++ b/activerecord/test/cases/validations_test.rb
@@ -63,19 +63,19 @@ class ValidationsTest < ActiveRecord::TestCase
end
def test_error_on_given_context
- r = WrongReply.new
+ r = WrongReply.new(:title => "Valid title")
assert !r.valid?(:special_case)
- assert_equal "Invalid", r.errors[:title].join
+ assert_equal "Invalid", r.errors[:author_name].join
- r.title = "secret"
+ r.author_name = "secret"
r.content = "Good"
assert r.valid?(:special_case)
- r.title = nil
+ r.author_name = nil
assert !r.save(:context => :special_case)
- assert_equal "Invalid", r.errors[:title].join
+ assert_equal "Invalid", r.errors[:author_name].join
- r.title = "secret"
+ r.author_name = "secret"
assert r.save(:context => :special_case)
end