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 5f24446 commit 62e8145
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 Original file line Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ def test_has_no_key
assert_equal({ foo: "omg" }, errors.messages) assert_equal({ foo: "omg" }, errors.messages)
end 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 test "values returns an array of messages" do
errors = ActiveModel::Errors.new(self) errors = ActiveModel::Errors.new(self)
errors.set(:foo, "omg") errors.set(:foo, "omg")
Expand Down

0 comments on commit 62e8145

Please sign in to comment.