aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2017-01-18 16:09:58 +0900
committerAkira Matsuda <ronnie@dio.jp>2017-01-18 17:30:46 +0900
commit5349d4ee080ff6da892081eae871a195847353c1 (patch)
tree60c6ebacfc509551b8eadb5ed74a5f66791cd200 /actionview
parent044f8bdf625dae78e4e230b9c61d9881864e2def (diff)
downloadrails-5349d4ee080ff6da892081eae871a195847353c1.tar.gz
rails-5349d4ee080ff6da892081eae871a195847353c1.tar.bz2
rails-5349d4ee080ff6da892081eae871a195847353c1.zip
:warning: "Use assert_nil if expecting nil. This will fail in MT6."
These are followups for 307065f959f2b34bdad16487bae906eb3bfeaf28, but TBH I'm personally not very much confortable with this style. Maybe we could override assert_equal in our test_helper not to warn?
Diffstat (limited to 'actionview')
-rw-r--r--actionview/test/template/erb_util_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionview/test/template/erb_util_test.rb b/actionview/test/template/erb_util_test.rb
index 0a16364ed3..4412ea37fa 100644
--- a/actionview/test/template/erb_util_test.rb
+++ b/actionview/test/template/erb_util_test.rb
@@ -51,7 +51,12 @@ class ErbUtilTest < ActiveSupport::TestCase
def test_json_escape_does_not_alter_json_string_meaning
JSON_ESCAPE_TEST_CASES.each do |(raw, _)|
- assert_equal ActiveSupport::JSON.decode(raw), ActiveSupport::JSON.decode(json_escape(raw))
+ expected = ActiveSupport::JSON.decode(raw)
+ if expected.nil?
+ assert_nil ActiveSupport::JSON.decode(json_escape(raw))
+ else
+ assert_equal expected, ActiveSupport::JSON.decode(json_escape(raw))
+ end
end
end