From 08d9ef583279d7684f2f5e21fab56c7ea6dc2d56 Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Wed, 13 Jan 2021 21:01:12 -0800 Subject: [PATCH] rename spec file; add test for nil content --- .../{content_sanitizer.rb => content_sanitizer_spec.rb} | 8 ++++++++ 1 file changed, 8 insertions(+) rename spec/services/{content_sanitizer.rb => content_sanitizer_spec.rb} (87%) diff --git a/spec/services/content_sanitizer.rb b/spec/services/content_sanitizer_spec.rb similarity index 87% rename from spec/services/content_sanitizer.rb rename to spec/services/content_sanitizer_spec.rb index f00a9e8db6..8e2117c1e8 100644 --- a/spec/services/content_sanitizer.rb +++ b/spec/services/content_sanitizer_spec.rb @@ -21,6 +21,10 @@ describe ContentSanitizer do it "replaces double escaped ampersands" do expect(service.strip_content("pb & j")).to eq("pb & j") end + + it "echos nil if given nil" do + expect(service.strip_content(nil)).to be(nil) + end end context "#sanitize_content" do @@ -45,5 +49,9 @@ describe ContentSanitizer do it "replaces double escaped ampersands" do expect(service.sanitize_content("pb & j")).to eq("pb & j") end + + it "echos nil if given nil" do + expect(service.sanitize_content(nil)).to be(nil) + end end end