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