Skip to content

Commit

Permalink
Failing test for issue rails#1513
Browse files Browse the repository at this point in the history
  • Loading branch information
markmcspadden committed May 18, 2012
1 parent b23ac93 commit eb7eb0a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions activemodel/test/cases/validations_test.rb
Expand Up @@ -120,6 +120,24 @@ def test_errors_empty_after_errors_on_check
assert t.errors.empty?
end

def test_errors_on_base_on_frozen_object
t = Topic.new
t.freeze
t.errors.add(:base, :invalid)
assert t.invalid?
assert_equal ["is invalid"], t.errors[:base]
assert_equal 1, t.errors.count
end

def test_errors_on_attribute_on_frozen_object
r = Reply.new
r.content = "Mismatch"
r.freeze
assert r.invalid?
assert_equal ["is Empty"], r.errors[:title]
assert_equal 1, r.errors.count
end

def test_validates_each
hits = 0
Topic.validates_each(:title, :content, [:title, :content]) do |record, attr|
Expand Down

0 comments on commit eb7eb0a

Please sign in to comment.