docbrown/spec/services/feeds/clean_html_spec.rb
Michael Kohl 1ce8a762b7
Move HtmlCleaner from app/labor into service (#11609)
* Move HtmlCleaner from app/labor into service

* Move to Feeds:: namespace
2020-11-27 08:21:57 +07:00

15 lines
425 B
Ruby

require "rails_helper"
RSpec.describe Feeds::CleanHtml, type: :service do
let(:html) do
<<~HTML
<img src="#{Feeds::CleanHtml::MEDIUM_TRACKING_PIXEL}" />
<p>#{Feeds::CleanHtml::MEDIUM_CATCHPHRASE}</p>
HTML
end
it "removes unwanted content", :aggregate_failures do
expect(described_class.call(html)).not_to include("<img>")
expect(described_class.call(html)).not_to include("<p>")
end
end