Skip to content

Commit

Permalink
Update test to new deprecation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-gomez committed Sep 25, 2024
1 parent d3dd8a9 commit da1bd33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/cases/base_errors_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_should_parse_json_string_errors_with_an_errors_key
mock.post "/people.json", {}, %q({"errors":["Age can't be blank", "Name can't be blank", "Name must start with a letter", "Person quota full for today.", "Phone work can't be blank", "Phone is not valid"]}), 422, "Content-Type" => "application/json; charset=utf-8"
end

assert_deprecated(/as an array/) do
assert_deprecated(/as an array/, ActiveResource.deprecator) do
invalid_user_using_format(:json) do
assert @person.errors[:name].any?
assert_equal ["can't be blank"], @person.errors[:age]
Expand All @@ -133,7 +133,7 @@ def test_should_parse_3_1_style_json_errors
mock.post "/people.json", {}, %q({"age":["can't be blank"],"name":["can't be blank", "must start with a letter"],"person":["quota full for today."],"phone_work":["can't be blank"],"phone":["is not valid"]}), 422, "Content-Type" => "application/json; charset=utf-8"
end

assert_deprecated(/without a root/) do
assert_deprecated(/without a root/, ActiveResource.deprecator) do
invalid_user_using_format(:json) do
assert @person.errors[:name].any?
assert_equal ["can't be blank"], @person.errors[:age]
Expand Down

0 comments on commit da1bd33

Please sign in to comment.