# Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ require 'rails_helper' RSpec.describe HtmlSanitizer::CidToSrc do let(:scrubber) { described_class.new } describe('#scrubber') do subject(:actual) { fragment.scrub!(scrubber).to_html } let(:fragment) { Loofah.fragment(input) } describe 'does not touch images without cid' do let(:input) { '' } let(:target) { '' } it { is_expected.to match target } end describe 'replaces source to cid when present' do let(:input) { '' } let(:target) { '' } it { is_expected.to match target } end describe 'does not touch non-images' do let(:input) { '
' } let(:target) { '' } it { is_expected.to match target } end end end