Permalink
Browse files

Tests for indifferent access using full_messages_for. Closes #11916

  • Loading branch information...
1 parent 58db2df commit 6dd0f68d1741c7bf840dfc3d3790714e89c49248 @PavelPenkov PavelPenkov committed with senny Aug 19, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 activemodel/test/cases/errors_test.rb
View
7 activemodel/test/cases/errors_test.rb
@@ -82,6 +82,13 @@ def test_has_no_key
assert_equal({ foo: "omg" }, errors.messages)
end
+ test "error access is indifferent" do
+ errors = ActiveModel::Errors.new(self)
+ errors[:foo] = "omg"
+
+ assert_equal ["omg"], errors["foo"]
+ end
+
test "values returns an array of messages" do
errors = ActiveModel::Errors.new(self)
errors.set(:foo, "omg")

0 comments on commit 6dd0f68

Please sign in to comment.