Skip to content

Commit

Permalink
Tests for indifferent access using full_messages_for. Closes #11916
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelPenkov authored and senny committed Mar 8, 2014
1 parent d682b0d commit d80efad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions activemodel/test/cases/errors_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ def test_has_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")
Expand Down

0 comments on commit d80efad

Please sign in to comment.