From a5fbfc5e8b1d00fcee4818321663033697660790 Mon Sep 17 00:00:00 2001 From: cavis Date: Fri, 17 Jan 2025 14:01:36 -0700 Subject: [PATCH] Don't rely on specific translations --- test/models/validators/redirect_prefix_validator_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/models/validators/redirect_prefix_validator_test.rb b/test/models/validators/redirect_prefix_validator_test.rb index efdf1f8ce..688829252 100644 --- a/test/models/validators/redirect_prefix_validator_test.rb +++ b/test/models/validators/redirect_prefix_validator_test.rb @@ -44,7 +44,7 @@ feed.enclosure_prefix = one.sub("/dovetail.prxu.org/zero.mp3", "") assert feed.invalid? - assert_includes feed.errors[:enclosure_prefix], "prefix not reachable" + assert feed.errors.added?(:enclosure_prefix, :unreachable) end it "validates duplicate https" do @@ -55,7 +55,7 @@ feed.enclosure_prefix = one.sub("/dovetail.prxu.org/zero.mp3", "") assert feed.invalid? - assert_includes feed.errors[:enclosure_prefix], "prefix not reachable" + assert feed.errors.added?(:enclosure_prefix, :unreachable) WebMock.disable_net_connect! end @@ -69,7 +69,7 @@ feed.enclosure_prefix = one.sub("/dovetail.prxu.org/zero.mp3", "") assert feed.invalid? - assert_includes feed.errors[:enclosure_prefix], "prefix not reachable" + assert feed.errors.added?(:enclosure_prefix, :unreachable) end it "validates too many redirects" do @@ -87,7 +87,7 @@ feed.enclosure_prefix = one.sub("/dovetail.prxu.org/zero.mp3", "") validator = RedirectPrefixValidator.new(attributes: [:enclosure_prefix], max_jumps: 2) validator.validate(feed) - assert_includes feed.errors[:enclosure_prefix], "too many redirects" + assert feed.errors.added?(:enclosure_prefix, :too_many_redirects) assert_requested(r1) assert_requested(r2) assert_requested(r3)