Permalink
Browse files

Tests for indifferent access using full_messages_for. Closes #11916

  • Loading branch information...
1 parent 5f24446 commit 62e8145430e0a327fa14975b84b9079cedf60863 @PavelPenkov PavelPenkov committed with senny Aug 19, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 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 62e8145

Please sign in to comment.