diff --git a/spec/repositories/story_repository_spec.rb b/spec/repositories/story_repository_spec.rb index fa392abdd..0cb547a8d 100644 --- a/spec/repositories/story_repository_spec.rb +++ b/spec/repositories/story_repository_spec.rb @@ -16,7 +16,7 @@ StoryRepository.add(entry, feed) end - it "sanitizes titles" do + it "deletes line and paragraph separator characters from titles" do entry = double(title: "n\u2028\u2029", content: "").as_null_object allow(StoryRepository).to receive(:normalize_url) @@ -24,6 +24,15 @@ StoryRepository.add(entry, feed) end + + it "deletes script tags from titles" do + entry = double(title: "n", content: "").as_null_object + allow(StoryRepository).to receive(:normalize_url) + + expect(Story).to receive(:create).with(hash_including(title: "n")) + + StoryRepository.add(entry, feed) + end end describe ".extract_url" do